When i do a webpage with 2 Session i get errors like :
Object reference not set to an instance of an object...
But when i have 1 session everything works fine..
how can i store more than 2 Session .. im sorry for my bad english..
WEB1
Session["Roli"] = f1txtRoli.Text;
Page.Response.Redirect("Faqja2.aspx");
Session["Emri"] = f1txtEmri.Text;
Page.Response.Redirect("Faqja2.aspx");
WEB2(FAQJA2.aspx)
f2txtRoli.Text = Session["Roli"].ToString();
f2txtEmri.Text = Session["Emri"].ToString();
Jignesh TrivediPosted Jan 30, 2012, 6:52 AM
use Convert.Tostring(Session["Roli"]) insted of Session["Roli"].ToString()
hope this help.
Krishna GaradPosted Jan 29, 2012, 11:36 PM
if(Session["Roli"]!=null&&Session["Emri"]!=null)
{//Now access the session variable like
f2txtRoli.Text = Session["Roli"].ToString();
f2txtEmri.Text = Session["Emri"].ToString();
}
else
{
//do
}