PageSession
, . , .
BasePage
. , Page
.
, PageInstanceUID
public string PageInstanceUID
{
get
{
ViewState["PageInstanceUID"];
}
set
{
ViewState["PageInstanceUID"] = value;
}
}
:
if(!IsPostBack)
{
PageInstanceUID = new FileInfo(Request.PhysicalPath).Name + Guid.NewGuid().ToString();
}
PageSession
PageSession
:
public class PageSession
{
readonly BasePage _parent;
public PageSession(BasePage parent)
{
_parent = parent;
}
public object this[string name]
{
get
{
return _parent.Session[GetFullKey(name)];
}
set
{
_parent.Session[GetFullKey(name)] = value;
}
}
public string GetFullKey(string name)
{
return _parent.PageInstanceUID + name;
}
}
Session BasePage
PageSession BasePage.
public PageSession PageSession
{
get
{
return _pageSesion;
}
}
, , , BasePage
Page
.