Session is server side, so you need to do it like this:
response.Write("<SCRIPT LANGUAGE=""JavaScript"">alert(""You do not have permissions to access this page.""); location.href = '" & Session("CurrentPage") & "' </SCRIPT>")
Frage
I need to redirect a user and i am using this JS code
response.Write("<SCRIPT LANGUAGE=""JavaScript"">alert(""You do not have permissions to access this page.""); location.href = 'Session("CurrentPage")' </SCRIPT>")
I am setting the session on each page i visit and in theory this should redirect to the page i was last on, any advice on how i would get this to work?
Lösung
Session is server side, so you need to do it like this:
response.Write("<SCRIPT LANGUAGE=""JavaScript"">alert(""You do not have permissions to access this page.""); location.href = '" & Session("CurrentPage") & "' </SCRIPT>")