08-29-2005, 12:29 AM
I am having problem in implementing this code:
<asp:hyperlink navigateURL='file.aspx?id=<%=session("id")%>' runat=server>Link Text</asp:hyperlink>
To avoid the nested quotes bug of .net, I have placed single quote around the navigateURL parameter but now this parameter is being treated as String, that is, it is not executing the <%=session("id")%> part and just showing it as a string.
Is there anyone to help me out?
08-29-2005, 08:54 PM
I use hyperlink column fine with embedded quotes with csharp like so:
NavigateUrl='<%# "?categoryid=" + DataBinder.Eval(Container.DataItem,"report_category_id") + "&office=" + Request.QueryString["office"] %>'>
<%# DataBinder.Eval(Container.DataItem,"report_category_name") %>
So, change the plus signs to ampersands (and the pound sign out?) if you're using VB.
08-30-2005, 12:47 AM
It does work fine with databind expression but not for other executable scripts like <%=session("id")%>
But Finally, I got it fixed after working on it for almost 24hrs !!!!!
THe solution is as follows:
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs) Handles MyBase.Load
link.NavigateURL = "logout.aspx?id=" & Session("id")
And the control was like this:
<asp:HyperLink ID="link" Runat="server" >Testing</asp:HyperLink>
I hope this will benefit some other people (like me) as well.
Also, does anybody know that this nested quotes bug has been fixed in 2.0 or not?
08-30-2005, 03:36 PM
Good to know. I haven't had that problem, but I might run into it. Thanks for posting the solution.
04-23-2009, 05:38 AM
hii, i want to ask something related to this,
how if i want send this hyperlink to someone's email
let say that it is link to change password,
i can create this parameter in the website, but i became confuse when i want to send this hyperlink to the user