I hope somoene out there can assist me. I am trying to convert my ASP skills to ASP.Net. I am using Expression Web as my IDE.
I have created a web page that successfully connects to an Access Datasource. I am querying "announcement" information which has a field for hyperlinks. The results of my query are passed to a Repeater Control.
All of my data is displayed properly except for the hyperlinks. What is displayed by the repeater control is the hyperlink surrounded by # signs.
Example: #
When I hover my mouse over the link I can see the link path actually shows the site name and then the link, again surrounded in # signs.
Example:
I have tried the suggestions in thread855-1294230 but no luck. Can anyone tell me what I am doing wrong?
Here are the bits of relevent code:
Best regards,
Mark
I have created a web page that successfully connects to an Access Datasource. I am querying "announcement" information which has a field for hyperlinks. The results of my query are passed to a Repeater Control.
All of my data is displayed properly except for the hyperlinks. What is displayed by the repeater control is the hyperlink surrounded by # signs.
Example: #
When I hover my mouse over the link I can see the link path actually shows the site name and then the link, again surrounded in # signs.
Example:
I have tried the suggestions in thread855-1294230 but no luck. Can anyone tell me what I am doing wrong?
Here are the bits of relevent code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data" %>
<script language ="vbscript" runat="server">
sub Page_Load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("/fpdb/announcements.mdb"))
dbconn.Open()
sql="SELECT StartDate, Subject, Announcement, link FROM Results WHERE StartDate <= Now AND EndDate >= Now ORDER BY 1 DESC"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
announcements.DataSource=dbread
announcements.DataBind()
dbread.Close()
dbconn.Close()
end sub
</script>
Code:
<form runat="server">
<asp:Repeater id="announcements" runat="server">
<HeaderTemplate>
<table border="1" width="100%">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Container.DataItem("StartDate")%> <%#Container.DataItem("Subject")%></td>
</tr>
<tr bgcolor="white">
<td><%#Container.DataItem("Announcement")%></td>
</tr>
<tr bgcolor="silver">
<td>
<asp:HyperLink id="hyperlink1"
NavigateUrl=<%# DataBinder.Eval(Container.DataItem, "link") %>
Text=<%# DataBinder.Eval(Container.DataItem, "link") %>
runat="server"/>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>
Best regards,
Mark