单击特定gridview行时如何查看特定行信息。 [英] How to view particular row information when click on particular gridview row.

查看:105
本文介绍了单击特定gridview行时如何查看特定行信息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnd,

我搜索了很多,但是当我点击gridview中的那一行时,我试图将特定的行信息查看到下一页。 thx提前

Hi frnd,
i search a lot but didn''t get anything i am trying to view particular row information into next page when click on that row which in gridview. thx in advance

推荐答案

在网格视图的模板字段中尝试此代码



Try this code inside your templatefield of the grid view

<pre lang="xml"><ItemTemplate>
                <button class="view" onclick="window.location='./ViewDetails.aspx?Id=<%# DataBinder.Eval(Container.DataItem,"Id") %>'; return false;"></button>









Id应该是主键或唯一键。





the Id should be the primary or unique key .


使用它,



Use this,

<asp:TemplateField>
<HeaderTemplate>View</HeaderTemplate>
<ItemTemplate>
<a id="lnk" href='ViewDetails.aspx?id=<%# Eval("Id") %>' target="_blank">View Details</a>
</ItemTemplate>
</asp:TemplateField>





在ViewDetails.aspx页面中获取带有id名称的查询字符串值,并使用此id检索数据并绑定数据。



in ViewDetails.aspx page get query string value with id name, and retrieve data by using this id and bind your data.


这篇关于单击特定gridview行时如何查看特定行信息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆