ASP:Hyperlink Control Question

G

Guest

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">
 
B

bruce barker

only binding expressions (<%# %>) are allowed in server tags, try:

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

-- bruce (sqlwork.com)


| 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">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top