Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display URL Link in page 1

Status
Not open for further replies.

mapman04

IS-IT--Management
Mar 28, 2002
158
US
I am trying to display the URL link to some documents. I can get the document names to appear but it doesn't show the URL. If I remove the A Href, it prints the path to the file. I want the user to be able to click on the URL to open the document. What am I doing wrong? Is there a better way to do this?

Thanks,

Mapman04

<%@ Import Namespace="System.Data.OleDb" %>

<html>
<head>
<title>ISO Document Search</title>
<script runat="server" language="VB">
Sub getData(s As Object, e As EventArgs)
Dim objConn As OleDbConnection
Dim objCmd As OleDbCommand
Dim objRdr As OleDbDataReader

objConn = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=F:\Files\adbWeb.mdb")
objCmd = New OleDbCommand("SELECT * FROM tblDocs WHERE fldKeyWord=@Name", objConn)
objCmd.Parameters.Add("@Name", txtSearch.Text)
objConn.Open()
objRdr = objCmd.ExecuteReader()
myRepeater.DataSource = objRdr
myRepeater.DataBind()
objRdr.Close()
objConn.Close()
End Sub
</script>
</head>
<body>
<IMG src=" Width="200" Height="100" />
<H2>ISO Document Search</H2>
<form runat="server">
<p><asp:TextBox id="txtSearch" runat="server"/>
<asp:Button id="btnSubmit" OnClick="getData" Text="Enter Search Word" runat="server"/></p>
<p><asp:Repeater id="myRepeater" runat="server">
<HeaderTemplate>
<table>
<tr>
<th>Document Name</th>
<th>URL Link</th>
</tr>
</HeaderTemplate>
<Itemtemplate>
<tr>
<td><%# Container.DataItem("fldDocName") %></td>
<td><A Href ="<%# Container.DataItem("fldDocLocation") %>"></A></td>
</tr>
</Itemtemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></p>
</form>
</body>
</html>
 
Have a look at the View Source of the page and post back with what is written out to the page using the code above.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Here's the source. It looks like it should list the URL but nothing appears in the column.

Thanks,

Mapman04


<html>
<head>
<title>ISO Document Search</title>

</head>
<body>
<IMG src=" Width="200" Height="100" />
<H2>ISO Document Search</H2>
<form name="ctl00" method="post" action="ISOSearch.ASPX" id="ctl00">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTA0NTUyMjEzNQ9kFgICAg9kFgICBQ8WAh4LXyFJdGVtQ291bnQCAhYEAg
EPZBYCZg8VAhlDb25kdWl0IERlc2NyaXB0aW9uIEd1aWRlMmh0dHA6Ly9hcm5jb25ldC9wYW
dlcy9Db25kdWl0X0Rlc2NyaXB0aW9uX0d1aWRlLlBkZAICD2QWAmYPFQIWQ29uZHVpdCBTcGV
jaWZpY2F0aW9ucydodHRwOi8vYXJuY29uZXQvcGFnZXMvQ29uZHVpdF9TcGVjcy5QZGZkZCNd
xNVZx2hFLQ8CYUuiCMXHbBOw" />
</div>

<p><input name="txtSearch" type="text" value="Conduit" id="txtSearch" />
<input type="submit" name="btnSubmit" value="Enter Search Word" id="btnSubmit" /></p>
<p>
<table>
<tr>
<th>Document Name</th>
<th>URL Link</th>
</tr>


<tr>
<td>Description Guide</td>
<td><A Href =" </tr>

<tr>
<td>Specifications</td>
<td><A Href =" </tr>


</table>
</p>

<div>

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwLj2dLNCgKZ7YzdCgLCi9reA64qROPCkF1RjJpMwTEW0eBfMu3c" />
</div></form>
</body>
</html>
 
You haven't specified any text between the anchor tags so it won't display anything...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks for pointing that out. This is my first web development project.

mapman04
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top