从第1页创建会话并检索到第3页 [英] Create session from page 1 and retrieve to Page 3
本文介绍了从第1页创建会话并检索到第3页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
会话[名称] //此会话仅用于Page3.aspx
会话[数字] //此会话仅用于Page 2
Respone.redirect(Page2.aspx)
会话[名称]只需要Page3.aspx,我如何存储并检索到Page3.aspx
订单是Page1.aspx> Page2.aspx> Page3.aspx,不能跳页。
Session["name"] //this session is only needed for Page3.aspx
Session["number"] //this session is only needed for Page 2
Respone.redirect ("Page2.aspx")
Session["name"] is only needed for Page3.aspx, how am I going to store this and retrieve to Page3.aspx
The order is Page1.aspx > Page2.aspx > Page3.aspx, cannot jump page.
推荐答案
我完全不明白你的问题。但我会在这里说一点关于Session
。
无论会话
您想要在页面中访问,该页面应该在转到该页面之前创建,或者您也可以在该页面中创建并访问页面内部。
当您创建任何会话
时,可以通过应用程序的所有页面访问该会话。如果您只需要特定于一个页面的内容,那么您应该使用ViewState
。您可以在单个页面中创建和使用ViewState
,这在应用程序的其他页面中无法访问,
I don't understand your question fully. But I would say one point here aboutSession
.
WhateverSession
you want to access in a Page, that should be created before going to that Page or you can create in that Page and access inside the Page as well.
When you create anySession
, that will be accessible through out all the Pages of the application. If you need something specific to one page only, then you should useViewState
. You can create and useViewState
in a single page, that can't be accessible in other pages of the application,
这篇关于从第1页创建会话并检索到第3页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文