Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 27, 2011 12:44 PM by vikas rathee
Jul 16, 2008 09:27 AM|LINK
Just my 2 $ in here :)
IIS 7.0 ships with a native module called CustomErrorModule that can be located inside the applicationHost.config file as follows:
<add name="CustomErrorModule" image="%windir%\System32\inetsrv\custerr.dll" />
The above module maps to the <httpErrors /> configuration section that allows you to define your own custom paths to errors and exceptions that might occur in your applicaiton.
So I believe the main reason for what was happening is that, you defined a module that has been already defined for you with the same name.
Either you remove the original module (which I don't recommend) through the <remove name="CustomErrorModule" /> element or simply use a different Name for the module you are registering!
Hope this clarifies the problem more!
Jul 18, 2008 03:19 PM|LINK
This is something I've been chasing for quite some time now - the ability for asp.net to produce a 404 response code, and redirect to a friendly page.
I've replicated your code (I was previously doing something similar in global.asax.cs); problem I've got is that when you put an event hander on context.Error, the Application_OnAuthenticateRequest hasn't fired - so you don't have a session (context.Session
= null). If I do a Server.Transfer, it goes to a friendly error page which inherits from a Master page that contains some basic functionality that reads the session, and it bombs out.
There *is* a session at this stage, I don't suppose you know of an alternative way of picking it up?
Thanks in advance,
Jul 18, 2008 11:17 PM|LINK
I tried running this and it worked for me locally but not on a shared host. It turned out to be a permissions issue with reading the web.config.
Sep 27, 2011 12:44 PM|LINK
Could you please solve this issue. http://forums.asp.net/p/1724466/4614255.aspx
Please let me know..