By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,993 Members | 1,883 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,993 IT Pros & Developers. It's quick & easy.

Can we show error message in Custom error defaultRedirect page

P: n/a
ad
I have a customErrors section in Web.config.

All error except error 403 and 404, will be redirect to
GenericErrorPage.aspx.

How can I show the e.Message or some explicit statement according the error
type in GenericErrorPage.aspx?

----------------------------------------------------------------------------
----------------------------------------------------
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.aspx">
<error statusCode="403" redirect="NoAccess.aspx"/>
<error statusCode="404" redirect="FileNotFound.aspx"/>
</customErrors>
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ad wrote:
I have a customErrors section in Web.config.

All error except error 403 and 404, will be redirect to
GenericErrorPage.aspx.

How can I show the e.Message or some explicit statement according the error
type in GenericErrorPage.aspx?

----------------------------------------------------------------------------
----------------------------------------------------
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.aspx">
<error statusCode="403" redirect="NoAccess.aspx"/>
<error statusCode="404" redirect="FileNotFound.aspx"/>
</customErrors>


Do you have Server access?
Change it in the IIS manager instead of the config perhaps?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2

P: n/a
dim e as exception = server.GetLastError()

though I dont think this will catch errors such as 404 which would usually
be caught by IIS. Good for catching exceptions in your app though... HTH jd

"ad" wrote:
I have a customErrors section in Web.config.

All error except error 403 and 404, will be redirect to
GenericErrorPage.aspx.

How can I show the e.Message or some explicit statement according the error
type in GenericErrorPage.aspx?

----------------------------------------------------------------------------
----------------------------------------------------
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.aspx">
<error statusCode="403" redirect="NoAccess.aspx"/>
<error statusCode="404" redirect="FileNotFound.aspx"/>
</customErrors>

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.