Last post Feb 03, 2011 07:26 AM by amitpathak024
Feb 03, 2011 04:23 AM|vijayalaxmi_21|LINK
I am getting this error.<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>can anyone help me?
can anyone help me?
Feb 03, 2011 05:44 AM|Rajneesh Verma|LINK
are you sure this block of code is out of commnet?
i think know you need to make it uncomment so that you can see acctual error.......
Probably you are getting below error:
Feb 03, 2011 05:49 AM|suresh_g_v2002|LINK
i think actual error is missing somehow...
<customErrors mode="On"/> in web.config and try to trace the actual error...
Feb 03, 2011 06:09 AM|vijayalaxmi_21|LINK
This is the complete error.
Server Error in '/' Application.
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security
reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors>
tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
Feb 03, 2011 06:19 AM|Rajneesh Verma|LINK
Yes to see the exact error enable below section from web.config
Feb 03, 2011 06:31 AM|amitpathak024|LINK
This error might occur due to two scenarios.
1. There is an error in the application's logic with the inputformat, Type etc., and you have set the Custom Error Mode in the web.config to "On" and not specified a default redirect error page.
2. The web.config file is not well formed or having invalid characters and the application is not able to pick up the settings from the same.
1. Set the custom error mode to "Off" to view the error. After rectifying it and before deployment, change it to "On" and specify a default error page, as follows:-
<customErrors defaultRedirect="ErrorPage.aspx" mode="On">
such that your users will not be able to see the actual error and get your friendly error page where you can politely say "An error has occured! Sorry for the inconvenience ..." .
2. If the above solution is not working (i.e. even after setting the custom error mode to On, the same "Server Error" occurs, then the likely chance is that your web.config file is not well formed and has invalid characters etc.,
To resolve, it copy paste the contents of the file to a notepad, save it as an xml file and try to browse the xml file in the browser. If the xml file is unable to be rendered by the browser and throws error, then you can find the place where the tags are not
well formed or invalid character(s) exist and rectify them.
Things worth noting is Web.config is case sensitive and even trailing / leading spaces can cause the above error.
Feb 03, 2011 06:34 AM|amitpathak024|LINK
just replace the customerrors tag with this
<customErrors mode="Off" >
ur code would be working
Feb 03, 2011 07:26 AM|amitpathak024|LINK
ur code would be working