Click here to Skip to main content
15,122,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
when i hosted my website in parallel panel and viewed in internet it showing error :
HTML
Server Error in '/' Application.

Runtime Error

Description: 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 -->
<pre lang="xml"><configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


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.


<!-- Web.Config Configuration File -->

XML
<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>


Then i added this code in my web.configuration:

XML
<configuration>
	<connectionstrings>
  <add name="ApplicationServices" connectionstring="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true">
   providerName="System.Data.SqlClient" />
  <add name="CRegConnectionString" connectionstring="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True">
   providerName="System.Data.SqlClient" />
  <add name="RegConnectionString" connectionstring="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Databasenw.mdf;Integrated Security=True;User Instance=True">
   providerName="System.Data.SqlClient" />
 </add></add></add></connectionstrings>
	<system.web>
    <customerrors mode="RemoteOnly" defaultredirect="default.aspx" />
  <authorization>
   <allow roles="Admin" />
  </authorization>
 ............

then again hosted the website.it showing the same error .why it is showing like this?
Posted
v6

The error message has clearly stated - what to do?

Add the lines in web.config
customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"
with
customErrors mode="Off"

just as shown in the error message.


Actually, you did not know what inter error happened. This could be of several reasons. Could be some IIS setting issue or any other issue related to web.config.
Once you add the line in web.config and run, you will now see the exact cause of the error.

Work out on the error that actually causes the application to throw exception and you are done.

I am sure you will be able to get the exact cause of the error and fix it by yourself.
Good Luck!

Cheers
   
Comments
Member 10467514 30-Dec-13 2:26am
   
i added this line in my web.config
<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">

then also it showing the same error
Sandip.Nascar 30-Dec-13 2:28am
   
Did you replace the line -
CustomErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"
with the new one.

If you haver done so, you should not get the same error instead the actual error.
Member 10467514 30-Dec-13 3:25am
   
Now it shows like this:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Detailed Error Information
Module DirectoryListingModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x00000000
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
Things you can try:
If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
Enable directory browsing using IIS Manager.
Open IIS Manager.
In the Features view, double-click Directory Browsing.
On the Directory Browsing page, in the Actions pane, click Enable.
Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.
Links and More Information
This error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server.


I placed a default.aspx page in the website.then why it is showing like this.........
The message itself is very self explanatory.

Youy need to add your default document to IIS settings.
Your directory browsing is set to off and probably you are entering the url like
www.your-domain.com and IIS could not locate the default page.

two ways to handle this -
1. Add your default document (i.e the first document may be login.aspx or default.aspx or whatever your aspx page is) to IIS settings

2. You add a simple index.htm or index.html

In the index.htm, add a javascript code to redirect the page to your aspx
window.location.href = "www.your-domain.com/login.aspx"

Pretty simple to solve your problem.

Cheers
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900