如何使用ahref传递Gridview列值 [英] How to pass Gridview column value using ahref
本文介绍了如何使用ahref传递Gridview列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨frnds ,,
如何在下面传递Gridview列值ahref
< a style =width:500px; height:500px>
我想使用上面的查询字符串将Gridview列值传递给下一页。
列名是FullName
这个我希望在下一页使用标签显示。
请帮助
Hi frnds,,
How to pass Gridview column value in this below ahref
I want to pass Gridview column value to next page using the above query string.
Column Name is FullName
This full i want to display in next page using label.
Please help
推荐答案
试试以下代码片段:
Try the below code snippet:
<a href="<%# "PageToTransfer.aspx?date=" + Eval("YourDBColumnName") %>" />
或
OR
<a href="<%# string.Format("PageToTransfer.aspx?date={0}", Eval("YourDBColumnName")) %>" />
您的要求不明确。但我的理解是你想在你的网格视图中放置一个href,它将有一个查询字符串,并且你想创建一个查询字符串,它将第一个名字作为参数。
请参阅下面的代码,它可能会给你一些想法。
Hi,
Your requirement is not clear. but what I understand is that you want to put an href in your grid view which will have a query string and that you want to make a query string which will have the first name as a parameter.
See the below code it might give you some Idea.
<asp:GridView ID="GridView1" runat="server" EnableModelValidation="True">
<Columns>
<asp:BoundField DataField="FirstName" HtmlEncode="False" DataFormatString="<a target='_blank' href='Test.aspx?firstname={0}'>Link Text Goes here</a>" />
</Columns>
</asp:GridView>
这篇关于如何使用ahref传递Gridview列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文