Creating a password page

  • Thread starter Thread starter Andrew Chalk
  • Start date Start date
A

Andrew Chalk

I want my ASP.NET application to be password-controlled. How do I prevent
page access without the user having gone to the password page first and
having logged in?

Does anyone know of any articales on this at any of the popular ASP.NET
sites?

Many thanks.
 
In the web.config file, you would have something like this, which would
redirect a user trying to login to the login.aspx page. You'll need to
create your authenication code on the login.aspx page. If you want a
complete solution, search for asp.net forms authentication and
something will probalby pop up.

<authentication mode="Forms">
<forms name="MyForm" loginUrl="login.aspx"/>
</authentication>

<authorization>
<deny users="?" /> <!-- Deny unathenticated users -->
</authorization>
 
In the web.config file, you would have something like this, which would
redirect a user trying to login to the login.aspx page. You'll need to
create your authenication code on the login.aspx page. If you want a
complete solution, search for asp.net forms authentication and
something will probably pop up.

<authentication mode="Forms">
<forms name="MyForm" loginUrl="login.aspx"/>
</authentication>

<authorization>
<deny users="?" /> <!-- Deny unathenticated users -->
</authorization>
 
Thanks all. I eventually referred to the topic on forms authentication in
the MS ASP.NET tutorial.

Regards,

Andrew
 

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

Back
Top