Error page that is not in "Forms Auth"

M

Marcus Olsson

Hi!

My web application directory is under Forms
Authentication. So if you go to page1.aspx you will be
redirected to login.aspx. login.aspx checks the database
for user and password information. But...

if the connection to the database is broken I want to
redirect to an error page that is not under Forms
Authentication, but located inside the web application
and its directory.

Is there a way to exclude certain page/pages from the
Forms Authentication inside the webconfig? or how do I
solve the problem the best/right way?

Please help!

Regards
/Marcus
 
M

Mike Moore [MSFT]

Hi Marcus,

You can use "Location" in the web.config file. Here's a portion of my
web.config which allows annonymous access to two pages, the login page plus
"ShowUsers.aspx".

<configuration>

<system.web>

<authentication mode="Forms">
<forms loginUrl="/FormsAuth1/login.aspx" name="MyAuthCookie"
protection="All" path="/FormsAuth1" timeout="20" >
</forms>
</authentication>

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

</system.web>

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

</configuration>

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top