Forms authentication - restricting certain pages

P

Paul Aspinall

Hi
I want to have most of my website available to users without any
authentication (ie. they can freely browse). However, if they go to a
restricted part, they should be redirected to a login page, and then
authenticated.

I don't want to use SQL Server, as I would have to pay for that with my
host. I would prefer to use Access, or even a custom method.

Does anyone have any sample code, or can point me to some resource examples?

Thanks
 
M

Mark Fitzpatrick

You can do it with Access just as easily as SQL Server. Any datasource will
work just fine and you can even put users into the web.config file if you
need to. Basically, you can write your own authentication method if you
need, and then just use some of the forms authentication features to handle
all your redirection and writing of the forms authentication cookies.

Check out some of these links as good starting points:

http://samples.gotdotnet.com/quickstart/aspplus/

http://www.15seconds.com/issue/020220.htm

http://msdn.microsoft.com/library/d...ml/cpconhandlingformsauthenticationevents.asp

http://www.4guysfromrolla.com/webtech/110701-1.shtml

The trick will be, you can only have one login form per application. You can
use the location element in the forms authentication config area to define
files that certain users can get access to.

There's also a sample project for the Membership providers done in MS
Access. You'll need at least Visual C# Express (which is free) to compile
it. To get it go to http://msdn.microsoft.com/vstudio/downloads/starterkits/
and scroll down to the Sample Access Provider link.
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top