I am trying to do something that I'm not sure is possible or not?
The user opens the website. If they try to reopen the link in a new tab I need to redirect them to another page.
I've tried using
bool IsPageRefresh = false;
ViewState["ViewStateId"] = System.Guid.NewGuid().ToString();
Session["SessionId"] = ViewState["ViewStateId"].ToString();
if (ViewState["ViewStateId"].ToString() != Session["SessionID"].ToString()) ;
IsPageRefresh = true;
if (IsPageRefresh == true)
Session["SessionId"] = System.Guid.NewGuid().ToString();
ViewState["ViewStateId"] = Session["SessionId"].ToString();
PageOpened=true , when the user opens it in the new tab check if there is a
cookie with PageOpened=true, if there is, open your other link in the browser.
You can give your cookies a time limit or destroy them when the first site is closed or when the user opens the new tab etc..
I can't provide you the code as I never worked with c# on web but this should give you an idea on possible routes to the solution.
P.S.: I would also find it irritating as a user but that is your call.