Click to See Complete Forum and Search --> : how to customize errors with asp.net/vb.net
LordHasan
06-05-2006, 08:30 AM
Hello
I think that my question is posted before but I didn't found answers so I'll ask it and if you please help me.
I'm making my first project with asp.net/vb.net and I don't know how to customize errors, while I'm searching I found that I can specify a page to be shown if an error accrues but I need to specify msg for each type of error.
ajn1888
06-07-2006, 06:57 AM
Use the following in your web.config file:
<customErrors defaultRedirect="./errors/404.aspx" mode="On">
<error statusCode="400" redirect="./errors/400.aspx" />
<error statusCode="401" redirect="./errors/401.aspx" />
<error statusCode="403" redirect="./errors/403.aspx" />
<error statusCode="404" redirect="./errors/404.aspx" />
<error statusCode="408" redirect="./errors/408.aspx" />
<error statusCode="500" redirect="./errors/500.aspx" />
<error statusCode="503" redirect="./errors/503.aspx" />
</customErrors>
You can create a page for each type of error as above, e.g. 500.aspx would be for an internal server error. On each page you can write your custom error message for the user to see.
AJN
LordHasan
06-07-2006, 07:18 AM
thanks
but this isn't what i need
somewhere for example a textbox where value should be positif for example so i need to costmize this error
ajn1888
06-07-2006, 08:01 AM
thanks
but this isn't what i need
somewhere for example a textbox where value should be positif for example so i need to costmize this error
Sorry, I'm not sure I understand the above.
Could you explain more please?
AJN