By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,749 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,749 IT Pros & Developers. It's quick & easy.

ASP:Hyperlink Control Question

P: n/a
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">
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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)
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.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">
Nov 19 '05 #2

P: n/a
Perfect - Thank you bruce!

"bruce barker" wrote:
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)
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.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">

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.