Last post Jun 01, 2010 03:12 PM by tottenham_rule_18
Jun 01, 2010 12:25 PM|tottenham_rule_18|LINK
Hi guys, I'm having a little problem with Asp.Net.
I am creating a site, and made a section where only Signed in Users can access.
I added this code to the web.config
<deny users="?" />
Which worked a treat. Any unauthenticated users are rejected and redirected to the Login page. I then read in a tutorial on this site, that I should add:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If Request.IsAuthenticated AndAlso Not String.IsNullOrEmpty(Request.QueryString("ReturnUrl")) Then
to the page_load event handler for the login page. However it's not redirecting to UnauthorizedAccess.aspx for some reason, and I just can't figure it. Any ideas?
If you need any more info, just say.
Jun 01, 2010 01:07 PMfirstname.lastname@example.org|LINK
Jun 01, 2010 03:12 PM|tottenham_rule_18|LINK
Wow it worked. Thanks mate!!