将对象传递到Asp.Net中的另一个页面 [英] Passing objects to another pages in Asp.Net
本文介绍了将对象传递到Asp.Net中的另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Asp.Net中将对象从页面传递到页面
How do i pass objects from pages to pages in Asp.Net
推荐答案
尝试
如何:在ASP.NET网页之间传递值[
在b.aspx中,您将获得对象;
var myObjectInstance = (MyObjectInstance) Session["Item"];
但是在使用它之前,您应该检查会话中是否设置了任何值.
参考链接 Stackoverflow [ ^ ]
有一个那里 [
Try
How to: Pass Values Between ASP.NET Web Pages[^]
You can save object in Session or Cache and then redirect to other page? Let’s say you have a.aspx in a.aspx you add item to Session.
Session["Item"] = myObjectInstance;
in b.aspx you will get object;
var myObjectInstance = (MyObjectInstance) Session["Item"];
but you should check if anyvalue is set in Session before using it.
Reference Link Stackoverflow[^]
have a go there[^] having same question with some perfect solutions.
如何将对象从页面传递到页面
会议?
应用程序变量?
您还可以使用其他状态管理技术,例如Cookies,PreviousPage概念等.
根据需要尝试.
How do i pass objects from pages to pages
Session?
Application variable?
You can also use other state-management techniques like Cookies, PreviousPage concept, etc.
Try as per your need.
这篇关于将对象传递到Asp.Net中的另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文