如何在没有Session的情况下在ASP.net c#中的页面之间传递对象而不是值? [英] How to pass objects, not values, between pages in ASP.net c# without Session?

查看:88
本文介绍了如何在没有Session的情况下在ASP.net c#中的页面之间传递对象而不是值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我将值从一个页面传递到另一个页面。我需要在页面之间传递对象,我怎么能这样做 ''没有Session''

解决方案

请参阅以下链接:



访问ViewState跨页面 [ ^ ]


您可以使用Context。 它还能够存储对象。这里需要注意的是,上下文只保存CURRENT请求的信息。如果你在页面上回传传递对象,那么它就会丢失,所以小心使用相同的。你可以在下面的链接上有很好的解释



使用ASP.NET中的Context.Items进行状态管理



通过Context对象将页面中的值传递给另一个页面



将值从一个页面传递到另一个页面 - ASP.NET





在页面之间传递数据:by Persist

At the moment I pass values from one page to another. I need to pass objects between pages, how can I do this ''without Session''.

解决方案

Refer below link :

Access ViewState Across Pages[^]


You can make use of Context. Its capable of storing objects also.Its important to note here that context saves information only for the CURRENT request.So if you do postback on the page you are passing the objects then it will be lost,so be carefull using the same.You can have very good explaination on the below link

State management with Context.Items in ASP.NET

Passing values from a page to another by means of the Context object

Passing Values from One Page to Another Page – ASP.NET


Passing Data Between Pages: by Persist


这篇关于如何在没有Session的情况下在ASP.net c#中的页面之间传递对象而不是值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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