Modifying the WEB.CONFIG custom error element?
In my default application I have the web.config file however I want to modify the custom errors section whereby if i am working in the development server then the custom errors will NOT be redirected to my custom page and if I am not in the development server then yes go ahead and redirect my user to the custom error page. I thought by using the KEYS in my configuration settings within my web.config file I could add that as an attribute to my custom errors element but I found out it does not work that way.
Here is my web.config setting in the custom errors element:
<customErrors mode="On" defaultRedirect="/errorhandle/errorhandle.aspx"/>
I had tried using this but it failed:
<customErrors environment="prod" mode="On" defaultRedirect="/errorhandle/errorhandle.aspx"/>
environment was one of the keys I have currently in my configuration settings/add appkeys element.
Coming from an VBScript background I could just wrap this statement in an IF ELSE STATEMENT but I can't seem to do that in this environment.
Any suggestions or direction on how I can do this would be appreciated.
Thanks.
|