在网格视图中传递选定的值 [英] Passing selected value in a gridview
本文介绍了在网格视图中传递选定的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我正在使用HyperLinkField Id传递选定的值是gridview,不确定此处是否在做正确的事,但是此代码仅将名称"内的值发送到另一页,以下是Hyperlinkfield:
Hi
Am using a HyperLinkField Id to pass selected value is a gridview, Not sure if am doing the right thing here but this code only sends the value inside "name" to another page, below is the Hyperlinkfield:
<Columns >
<asp:HyperLinkField HeaderText="Create Appointment" Text="Create Appointment"
DataNavigateUrlFormatString="AddPatients.aspx?name=GridViewRow.SelectedRow.Cells[2].Text" DataNavigateUrlFields="name" />
</Columns>
推荐答案
请按以下方式更改您的代码.
Hi,
Please change the your code as following.
<Columns >
<asp:HyperLinkField HeaderText="Create Appointment" Text="Create Appointment"
DataNavigateUrlFormatString="AddPatients.aspx?name='<% Eval('name') %>'" DataNavigateUrlFields="name" />
</Columns>
希望对您有帮助.
问候,
Kiran.
Hope this will help you.
Regards,
Kiran.
尝试以下代码
try with the following code
<asp:HyperLinkField DataNavigateUrlFields="Name"
DataNavigateUrlFormatString= "Default2.aspx?name={0}=" Text="Transfer values to other page" />
希望对您有帮助
hope it helps
这篇关于在网格视图中传递选定的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文