在formwiew中传递查询字符串中的id ... [英] passing an id in querystring within a formwiew...
本文介绍了在formwiew中传递查询字符串中的id ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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.
推荐答案
您好,
您可以按照以下方式进行:
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.
这篇关于在formwiew中传递查询字符串中的id ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文