D
dave
I have the following problem:
my web.config file (see below) protects the entire website and when a user
tries to go to a page they are redirected to the login - all is well..
However, even though they have been authenticated it is still returning to
the login page. However if i then go to the original page i wanted it will
let me in, as i have now been authenticated, so that part is working...
The login code is straight forward enough (see below), but i cannot for the
life of me work out why it keeps returning to the login page. I have tried
many variations to get me to the originally requested page, but no success.
Thanks in advance..
Web Config settings.
<configuration>
<system.web>
<customErrors mode="Off"/>
<pages smartNavigation="true"/>
<compilation debug="true"/>
<authentication mode="Forms" >
<forms name="App1" path="/" loginUrl="login.aspx" >
<credentials passwordFormat="Clear">
<user name="tester" password="testing" />
</credentials>
</forms>
</authentication>
<authorization>
<allow users="tester"/>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
Login Code.
sub DoLogin(objSender as Object, objArgs As EventArgs)
if FormsAuthentication.Authenticate(username.value, password.value) then
formsauthentication.redirectfromloginpage(username.value, "False")
end if
end sub
my web.config file (see below) protects the entire website and when a user
tries to go to a page they are redirected to the login - all is well..
However, even though they have been authenticated it is still returning to
the login page. However if i then go to the original page i wanted it will
let me in, as i have now been authenticated, so that part is working...
The login code is straight forward enough (see below), but i cannot for the
life of me work out why it keeps returning to the login page. I have tried
many variations to get me to the originally requested page, but no success.
Thanks in advance..
Web Config settings.
<configuration>
<system.web>
<customErrors mode="Off"/>
<pages smartNavigation="true"/>
<compilation debug="true"/>
<authentication mode="Forms" >
<forms name="App1" path="/" loginUrl="login.aspx" >
<credentials passwordFormat="Clear">
<user name="tester" password="testing" />
</credentials>
</forms>
</authentication>
<authorization>
<allow users="tester"/>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
Login Code.
sub DoLogin(objSender as Object, objArgs As EventArgs)
if FormsAuthentication.Authenticate(username.value, password.value) then
formsauthentication.redirectfromloginpage(username.value, "False")
end if
end sub