使用会话将数据从一页发送到另一页 [英] Use Session to send Data from one page to another

查看:130
本文介绍了使用会话将数据从一页发送到另一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的问题是我在 page1.aspx 中的gridview 中有一些数据,我想从 page1 移到 page2.aspx 仅包含gridview的选定行,因此如何在会话的帮助下进行此操作.

有人可以帮我吗?由于我是新手,所以我想了解它.请在会议的帮助下给我您的答复.

还有谁能告诉我在这种情况下使用会话的正确方法吗?

Hello,

My question is that I have some data in gridview which is in page1.aspx and I want to move to page2.aspx from page1 with only selected rows of gridview, so how can I do this with the help of session.

Can anybody please help me with this. As I am new to session, I want to understand it. Please give me your reply with the help of session.

And also can anyone tell me whether this is the right way to use session in such condition?

推荐答案

您愿意学习吗?如果是,则此处 [
Are you willing to learn? if So here [^] is all you need to know about sessions in order to do your job.


还有其他方法可以将数据从一页转移到另一页.根据跨页面共享网格数据的方案,可以使用会话.

如果您有
跨页回发 [
There can be other ways to transfer data from one page to other. Based on your scenario of having Grid data shared across pages, Session can be used.

If you have a Cross Page postback [^], then you can use PreviousPage property and get the data of the previous page.

You can also pass on the selected rows unique id''s in your URL as query string and then use them to get appropriate data. Pick the one that suits your website.


您可以将数据像
那样进行处理
you can put your data to sesssion like

Session["Data"] == /* put your datarow instance here */



并在其他页面上检索.



and retrieve same on the othe page.

if(session["Data"] != null)
{
DataRow _rowInstance = (DataRow)Session["Data"];
}



如果要浏览会话,请使用此
KB文章



and if you want to explore session use this KB Article

Thanks,
Hiren Solanki
{Mark as A Answer if it helps }


这篇关于使用会话将数据从一页发送到另一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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