user819774 user819774 - 6 months ago 40
Vb.net Question

HyperLink with NavigateUrl with Eval() didn't fire

I followed the answer on HyperLink with NavigateUrl with Eval(). Where is the mistake?. However it didn't open the page. Would someone tell me how to do it.

My code:

<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ActionNumber") %>' NavigateUrl='<%# String.Format("/orders/orderAction.aspx?orderID={0}", DataBinder.Eval(Container.DataItem, "ActionNumber")%>)' Target="_blank"> </asp:HyperLink>


I checked the control in html code like this using development tool in IE:

<a id="dgrd_ctl02_HyperLink1" href='<%#%20String.Format("/orders/orderBasics.aspx?orderID={0}", DataBinder.Eval(Container.DataItem, "ActionNumber")%>)'>VA_QA_5666</a>

Answer

The parentheses are not quite correct at the end of your NavigateUrl expression:

NavigateUrl='<%# String.Format("/orders/orderAction.aspx?orderID={0}", DataBinder.Eval(Container.DataItem, "ActionNumber")) %>'
Comments