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();
}
Server.transfer HTTPcontext.Items
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Suthish NairRank #92 · 22.8K reputationPosted Apr 26, 2011, 4:48 AM EDT
From which control event you transfer to another web page.
Different Ways to Pass Data between Web Forms