ASP.NET - Assistance with Hyperlink

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an ASP.NET web form that I'm developing, and I'm running into a
problem with my below code. Business rules aside, is there anything
noticably wrong with this syntax? This syntax is being used to create a
hyperlink in a template column of a datagrid. In the designer, once I
implement this code the word "Databound" appears in the column, but when I
display the page in browser it errors out on this line. Thanks.

<asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.FlitchNum") %> ' NavigateURL='<%# "Logs_Detail.aspx?id=" &
DataBind.Eval(Container, "DataItem.FlitchNum") %>' Target="_self"
ID="Hyperlink2">
</asp:HyperLink>
 
Hi,
If this is on C#, use the + opertor instead of & for string concatenation
(inside NavigateUrl attribute value).

I have an ASP.NET web form that I'm developing, and I'm running into a
problem with my below code. Business rules aside, is there anything
noticably wrong with this syntax? This syntax is being used to create a
hyperlink in a template column of a datagrid. In the designer, once I
implement this code the word "Databound" appears in the column, but when I
display the page in browser it errors out on this line. Thanks.

<asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.FlitchNum") %> ' NavigateURL='<%# "Logs_Detail.aspx?id=" &
DataBind.Eval(Container, "DataItem.FlitchNum") %>' Target="_self"
ID="Hyperlink2">
</asp:HyperLink>
 
Shiva, As it turns out it looks like there is a connection string problem
causing this. Thanks.
 
Back
Top