如何在会话中存储gridview单元格值 [英] How to store a gridview cell value in a session
本文介绍了如何在会话中存储gridview单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个已填充的gridview.我还有一个用户单击的动态超链接列.当他们单击此链接时,我希望将该单元格的值存储在会话中.我需要此会话变量才能在新页面上加载数据.
Hi all,
I have a gridview that is populated. I also have a dynamic hyperlink column that the user clicks on. When they click on this link, I want the value of that cell to be stored in a session. I need this session variable to load data on the new page.
Any answer will be higly appreciated
推荐答案
您可以使用层后面的代码来实现它:
You can achieve it using code behind layer as:
MyDataItem item = (MyDataItem)GridView1.Rows[GridView1.SelectedIndex].DataItem;
Session["myItem"] = item;
这篇关于如何在会话中存储gridview单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文