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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass variable into asp:Hyperlink NavigateURL property

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
I am attempting to pass a parameter named "BackURL" into a asp:Hyperlink HTML control as shown below. "BackURL" is actually a variable defined in the page's code-behind. However, my current formatting below causes a "Page
cannot be displayed" error, and is invalid.

How can I properly reference my BackURL variable in the NavigateURL property
of the asp:Hyperlink control? Thanks.

<asp:HyperLink runat="server" Text="Update" NavigateURL='<%#
"Update_Order.aspx?id=" & DataBinder.Eval(Container, "DataItem.OrderID")&
"&BackURL=" & <%=BackURL%>%>' Target="_blank" ID="Hyperlink2">


--
Regards,
Mike
 
You're nesting <% and %> tags. You have <%# ... <%= ... %> %>. You can't break into code when you've already broken into code. The short of it is, lose the inner nesting of tags, just change <%=BackURL%> to BackURL.

________________________________________
Andrew

I work for a gift card company!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top