dynamically allowing anonymous users to web pages???

P

Pedro

I have a web application that has a custom HttpHandler that has the
following mapping

http://myhost/mywebapp/site/page.aspx to
http://myhost/mywebapp/page.aspx?id=site

All pages have a predefined layout based on the site that is handled
by a
common base class.
I use forms authentication that denies all anonymous acces

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

My problem is that each site has a login page and a register page.
When an anonymous users try to access a page, it gets redirected to
the login page.
I want to make an exception. I want that when an anonymous user tries
to access the register page (registers.aspx), it should be able to do
it.
I know this can be done in the web.config file:

<location path="site1/register.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>

<location path="site2/register.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>

<location path="site3/register.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>

....

but what i really want is not having to add a new entry to the
webconfig when i add a new site (maybe using global.asax
Authenticaticate event) but still using Forms authentication.

Is this possible? if so, how?
Thanks a lot!
 

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,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top