Server.transfer HTTPcontext.Items
If I use server.transfer to pass data between pages and a user bookmarks the second page how do I prevent an error e.g.
Page 1 code behind
string var="text";
Context.Items["WebForm1var"] = var;
Server.Transfer("page2.aspx");
Page 2 code behind
string2=Context.Items["WebFormvar"].ToString();
---------------------------------------------------------------------
Can I preface the code in page 2 with
if(Context.Items["WebFormvar"])
{
string2=Context.Items["WebFormvar"].ToString();
}