469,572 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Single customErrors For Multiple system.web in web.config

111 100+
Hi,

I want to use the <customErrors> for all <system.web></system.web>

If error occure this should be called.

I have to write it once not in every <system.web></system.web>.

How can I?


<system.web>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="Login" timeout="10" path="/" protection="All" defaultUrl ="Home.aspx"></forms>
</authentication>

<customErrors defaultRedirect="CustomErrors/ErrorPage.aspx" mode="On">
<error statusCode="500" redirect="CustomErrors/ServerError.aspx" />
<error statusCode="404" redirect="CustomErrors/FileNotFound.aspx" />
<error statusCode="403" redirect="CustomErrors/AccessDenied.aspx" />
</customErrors>


</system.web>

<location path="Files" allowOverride="false">
<system.web>
<authorization>
<allow roles="User"/>
<deny roles ="Admin"/>
<deny users="?"/>
</authorization>

<customErrors defaultRedirect="CustomErrors/ErrorPage.aspx" mode="On">
<error statusCode="500" redirect="CustomErrors/ServerError.aspx" />
<error statusCode="404" redirect="CustomErrors/FileNotFound.aspx" />
<error statusCode="403" redirect="CustomErrors/AccessDenied.aspx" />
</customErrors>


</system.web>
</location>

Thanks in advance.
Feb 6 '08 #1
0 863

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Samuel | last post: by
6 posts views Thread by John Smith | last post: by
21 posts views Thread by nicholas | last post: by
1 post views Thread by Chumley Walrus | last post: by
reply views Thread by dw | last post: by
9 posts views Thread by =?Utf-8?B?TWlrZQ==?= | last post: by
3 posts views Thread by Tahir | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.