Okay i've got this code in the web.config below.
My issue is for this testpage.aspx if the user isnt either user 1 or user 2, then i'd like to redirect them to another page BUT i already have this code below for a redirect to the login page but i don't want them to refer back to the login page for this specific testpage.aspx
Rather than setting up a role, could i just create an If statement on the testpage.aspx and if so would it be something like this.. I would appreciate any help.
Code:
<location path="testpage.aspx">
<system.web>
<authorization>
<allow users="user2, user1"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
My issue is for this testpage.aspx if the user isnt either user 1 or user 2, then i'd like to redirect them to another page BUT i already have this code below for a redirect to the login page but i don't want them to refer back to the login page for this specific testpage.aspx
Code:
<authentication mode="Forms">
<forms loginUrl="login.aspx"/>
</authentication>
Rather than setting up a role, could i just create an If statement on the testpage.aspx and if so would it be something like this.. I would appreciate any help.
Code:
If request.LogonUserIdentity.....
Response.Redirect("/")
End If