As Marc Redman said, you can use Viewstate + Session to store values specific to this page. ViewState is good for storing a key (string), a session for storing any type of complex objects.
Use ViewState or a hidden field to load the first time the GUID is called.
public string PageUid { get { if (ViewState["UID"] == null) ViewState.Add("UID", Guid.NewGuid().ToString()); return ViewState["UID"].ToString(); } }
Then use the session to get / set your values with this key:
string MyPagesessionVariable { get { if (Session["MYVAR" + PageUid] == null) { Session["MYVAR" + PageUid] = "VALUE NOT SHARED WITH OTHER TABS/WINDOWS"; } return Session["MYVAR" + PageUid]; } set { Session["MYVAR" + PageUid] = value; } }
Matteo conta
source share