ASP.NET中Gridview列中的超链接 [英] Hyperlink in Gridview Column in ASP.NET
本文介绍了ASP.NET中Gridview列中的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在ASP.NET中向gridview添加一列,此列应该包含Hyperlink,我想导航到一个特定的页面,点击的单元格值将使用get方法传递。
如何在asp.net(C#)中执行此操作?
我可以制作元素超链接,但是如何传递所选值?
以下是我的aspx代码
I want to add a column to gridview in ASP.NET, this column should contain Hyperlink and i want to navigate to a particular page with the clicked cell value to be passed using the get method.
How to do this in asp.net(C#)?
I can make the element hyperlink, buut how to pass the selected value?
following is my aspx code
<Columns>
<asp:CommandField HeaderText="" ShowEditButton="True" />
<asp:TemplateField HeaderText="Poject Name">
<ItemTemplate>
<asp:HyperLink ID="PROJ_NAME" runat="server" DataNavigateUrlFields="PROJ_NAME" NavigateUrl='<%# "~/SummaryReport.aspx?name=" %>'
Text='<%# Eval("PROJ_NAME") %>' ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UPLOADED" HeaderText="Uploaded" ReadOnly="True" />
<asp:BoundField DataField="EXPECTED_DATA" HeaderText="Expected Data" />
<asp:BoundField DataField="CURRENT_DATA" HeaderText="Current Data" ReadOnly="True"/>
<asp:BoundField DataField="COMPLETED" HeaderText="Completed" ReadOnly="True"/>
</Columns>
我是ASP.NET的新手,任何帮助都会受到赞赏..提前感谢..
I am new to ASP.NET, any help will be appreciated.. thanks in advance..
推荐答案
您好Avik,
我认为代码会稍微改变一下。
更新NavigateUrl属性:
NavigateUrl =''<%#〜/ SummaryReport.aspx?name = {0}%> ;''
欲了解更多信息,请点击以下链接:
在GridView中使用超链接 < br $> b $ b
使用超链接
how-to-pass-multiple-values-using-gridview-hyperlinkfield
如果他们帮助您找到解决方案,请不要忘记将有用的回复标记为答案。
Hi Avik,
I think the code will work with a little change.
Update NavigateUrl property :
NavigateUrl=''<%# "~/SummaryReport.aspx?name={0}" %>''
For more information you follow below links:
Using Hyperlinks in GridView
Using Hyperlinks
how-to-pass-multiple-values-using-gridview-hyperlinkfield
Don''t forget to mark useful responses as Answer if they helped you towards a solution.
这篇关于ASP.NET中Gridview列中的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文