ASPNET2.0 Membership Multiple login redirections


S

Steven Nagy

Hi All,

I can successfully specify access levels to folders and files with no
problem through web.config.
In my application I have 2 folders off root:
/Admin/
/Members/

When a person tries to go to /Admin/default.aspx they should get
redirected to /Admin/login.aspx
Similarly, when a person tries to go to /Members/default.aspx they
should get redirected to /Members/login.aspx

As it stands, I can only specify one login page for the application,
which is currenly set to /Admin/login.aspx.
So currently if the unlogged in user tries to go to /Members/
default.aspx they end up redirected to /Admin/login.aspx.

Naturally I COULD have just one login page and redirect the user
depending on role. But I'd like to solve the above problem first.

Can this be done in web.config with all the other authentication
settings?

Cheers,
Steven
 
Ad

Advertisements

G

Guest

As it stands, I can only specify one login page for the application,

Steven, you can create an application (a virtual directory) for the /
Members
I think this is the only way
 
S

Steven Nagy

you can create an application (a virtual directory) for the /
Members

Hi,

That's a nice answer. I hadn't thought of it but it makes sense.
The only problem is that in shared hosting environments you don't
always have control over that stuff.

I suppose I can restructure but I would have thought this something
that would be required by a few people, not just me.
Surely its not that uncommon?

Thanks for your answer,
Steven
 
Ad

Advertisements

G

Guest

Hi,

That's a nice answer. I hadn't thought of it but it makes sense.
The only problem is that in shared hosting environments you don't
always have control over that stuff.

I suppose I can restructure but I would have thought this something
that would be required by a few people, not just me.
Surely its not that uncommon?

Thanks for your answer,
Steven

You can either use a role-based security (the standard way), or two
virtual directories, or you may also implement a custom authentication
against your database.

For custom authentication you would need a datasource and a webform

Here is a very basic example using a flat XML
http://aspalliance.com/505_CodeSnip_Forms_Authentication_Against_an_XML_File
 

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

Top