Another way is to use a session variable that is passed only from certain pages…You can do such a think by instantiating the variable in an onclick event on the server side. The coding is pretty simple, it’s just:
VB.NET:
Session(“mySession”) = myValue
C#
Session["mySession"]=myValue;
Then, you can set up an if block to check on the page load event if the session variable exists and is set properly. If not, redirect the user. I’ve used a simply boolean value assigned to a session variable to set whether the user can access a page or not before.
Comments
Leave a comment Trackback