Click here to Skip to main content
15,894,252 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working with asp.net website, when i host it in the server , am unable to redirect to my index page.
I am using this code..

XML
<customErrors mode="Off" defaultRedirect="index.aspx"/>
    <authentication mode="Forms" >
      <forms loginUrl="index.aspx" timeout="2880" defaultUrl="index.aspx"/>
    </authentication>



and mentioned this also

XML
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <defaultDocument enabled="true">
      <files>
        <clear />
        <add value="Index.aspx" />
      </files>
    </defaultDocument>
  </system.webServer>


please help me with a solution...
Posted
Updated 24-Jun-13 8:27am
v2

1 solution

You set
C#
<customerrors mode="off"></customerrors>

A brief explaination for CustomErrors mode:
Quote:
There are three error modes in which an ASP.NET application can work:

1) Off Mode
2) On Mode
3) RemoteOnly Mode

The Error mode attribute determines whether or not an ASP.NET error message is displayed. By default, the mode value is set to "RemoteOnly".
Off Mode

When the error attribute is set to "Off", ASP.NET uses its default error page for both local and remote users in case of an error.
On Mode

In case of "On" Mode, ASP.NET uses user-defined custom error page instead of its default error page for both local and remote users. If a custom error page is not specified, ASP.NET shows the error page describing how to enable remote viewing of errors.
RemoteOnly

ASP.NET error page is shown only to local users. Remote requests will first check the configuration settings for the custom error page or finally show an IIS error.


Reference link: Custom Errors in ASP.NET[^]

Please change your mode to the proper one.

Good luck,
OI
 
Share this answer
 
Comments
Thanks7872 25-Jun-13 0:19am    
Excellent explenation..↑voted.
Orcun Iyigun 25-Jun-13 1:25am    
Thanks Rohan :)

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