You may use Session variable to store that object and use it in another page.
//Set the session
Session["p1"]=pOne;
Session["x1"]=xOne;
页: 1
if(Session["p1"]!=null)
{
// If object is present in session, Cast that to our class (PClass) type
PClass objP1=(PClass) Session["p1"];
//Now you can use objP1
}
if(Session["x1"]!=null)
{
XClass objx1=(XClass) Session["x1"];
//Now you can use objx1
}
在获得可变变量之前总是进行无效检查是一种良好做法。
www.un.org/Depts/DGACM/index_spanish.htm 这里是VB。 NET版本(我希望这项工作,在VB中我没有什么经验)。 NET
// Set the Session
Session("p1")=pOne
Sesssion("x1")=xOne
第二页改为本届会议
if Session("p1") IsNot Nothing Then
Dim objP1 As pClass
objP1=CType(Session("p1"),pClass)
Now you can use objP1
End If
if Session("x1") IsNot Nothing Then
Dim objX1 As xClass
objX1=CType(Session("x1"),xClass)
Now you can use objX1
End If