简体   繁体   中英

ASP.Net aspxerrorpath=/Login.aspx

I recently uploaded my asp.net website to a hosting server. But now when I query the URL: http://paracha.net/ it gives me a 404 error. This 404 error page is rendering from my own specified custom error in Web.config

Snapshot of error page

I am scratching my head about the problem, searched alot but no luck. This is my really first asp.net website that I am trying to host online. It works great on localhost. I created it from scratch.

I don't know what I have done wrong thats causing the error. Any help would be appreciated. The contents of my Web.config file are listed below:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="ConnectionString" value="6PxGIlfmR+SIQQeQxclyvZkdYPeZCxACddWp3Xo8UmzL3ySf3l88buc8VEZkmH/pztsiJqd687ma1RmcwG9OEwd72O12ak5Nhn6Ulcjy20M=" />
    <add key="EncryptionKey" value="BD3/VpyzkrX//Mn2FWQev0yHUvftOQGr" />
    <add key="LogPath" value="C:\Logs\" />
    <add key="CrystalImageCleaner-AutoStart" value="true" />
    <add key="CrystalImageCleaner-Sleep" value="60000" />
    <add key="CrystalImageCleaner-Age" value="120000" />
  </appSettings>

  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      </assemblies>
    </compilation>

    <authentication mode="Forms">
      <forms defaultUrl="~/Home/Home.aspx" loginUrl="Login.aspx" slidingExpiration="true" timeout="2880" />
    </authentication>

    <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx">
      <error statusCode="404" redirect="~/Error.aspx" />
    </customErrors>

    <httpHandlers>
      <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
    </httpHandlers>

    <urlMappings>
      <add url="~/Home/" mappedUrl="~/Home/Home.aspx" />
      <add url="~/Home/ItemStock/" mappedUrl="~/Home/Home.aspx" />
    </urlMappings>
  <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
      </controls>
    </pages></system.web>

  <system.webServer>
    <defaultDocument enabled="true">
      <files>
        <clear />
        <add value="Login.aspx" />
      </files>
    </defaultDocument>
    <handlers>
      <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

</configuration>

Guys I found the problem.

As @Manraj said I tried:

<customErrors mode="Off"/>

After refreshing the page I saw that SQL Server is unable to login with default user "sa", So I quickly realized that the database connection string is not correct. I changed the connection string. and It works fine now. :)

Tip for people who might face this problem. customErrors override the original error details and hide the stack trace as well. So If you are facing some sort of error try to turn off customErrors then check whats the actual error.

Thanks alot

It seems some exception has occurred in the application and it has been redirected to the error page. This will usually happen when the application moves from development environment to production environment. If you are using any error logs check the error log for the exception or remove the custom error tag and see what exactly the error is and rectify it. The ultimate thing is you have to find out what is the exception and rectify it. If you not using any error log try using error log like log4net and log the exceptions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM