Redirect visitors to registration page

P

Paul Evans

Hi,

I've set up forms based authentication. What I'm not sure how to do is
redirect visitors (who have not logged on) to the registration page, when
they request a web page they are not authorised to view.

Can anyone help me?

Thanks for your time

Paul Evans
 
J

John Saunders

Paul Evans said:
Hi,

I've set up forms based authentication. What I'm not sure how to do is
redirect visitors (who have not logged on) to the registration page, when
they request a web page they are not authorised to view.

If you have Forms Authentication set up properly and if you have
Authorization set up so that the user can't access a page then Forms
Authentication will redirect the user to the login page. Is this not
happening?

John Saunders
 
G

Guest

In the authentication element, add a forms element to tell the app what form
to use for login, like this...

<authentication mode="Forms">
<forms loginUrl="Registration.aspx" />
</authentication>

Also, make sure you exclude only unauthenticated users from the rest of the
site by adding an authorization element inside your configuration element,
like this...

<configuration>
...
<authorization>
<deny users="?" />
</authorization>
...
</configuration>

The '?' represents all unauthenticated users.

<itinerantCoder />
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top