Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
XML
<a href="ViewExternalWebSite.aspx?UserId=<%# Eval("UserId") %>">
<%# Eval("Name")%></a>


Now, Url- <pre lang="vb">ViewWebSite.aspx?UserId=15</pre>

But I want to change UserName/UserId/15
Posted
Comments
Sergey Alexandrovich Kryukov 8-Jul-14 3:20am    
And what's the problem? What you show is not "change", it just generates some URL from server-side data...
—SA
Abhishek Burrnwal 8-Jul-14 3:40am    
I want to dynamic url.
Now, anchor tag link click after that Url- ViewExternalWebSite.aspx?UserId=1

But I want Url- UserName/UserId

1 solution

use HyperLink
C#
<asp:HyperLink id="hyperlink1" NavigateUrl='<%# Eval("UserId","ViewExternalWebSite.aspx?UserId={0}") %>' runat="server" />

then you can access control from code behind
C#
hyperlink1.NavigateUrl =newUrl;
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900