Click here to Skip to main content
15,905,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
hello guys,

I have a FormView where I show some data from a client, such as your id_client, name, surname, among others. I'm intending to put a link or a button to redirect to another page, but this should pass the customer id in querystring to be picked up later.

my question is how to pass this id_client since the formview is populated using data loaded from a datasource.
 This problem could be solved this way:
<a href = "~ / Client / ShowClient.aspx? id = <% # DataBinder.Eval (Container.DataItem," id_client "). ToString ()%> '> Show </ a>

but this does not work because the page I have my formview is in another folder you want to redirect.
Posted

1 solution

Hi,

you can do it as follows:

<asp:hyperlink runat="server" navigateurl='<%# string.Format("~/Client/ShowClient.aspx?id={0}", HttpUtility.UrlEncode(Eval("id_client").ToString()))%>' Text='Redirect'>
</asp:hyperlink>


Hope it helps.
 
Share this answer
 
v4
Comments
fasher_the_one 2-Aug-13 7:48am    
Harshil_Raval,

thanks for this solution. has served me perfectly. grateful

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