简体   繁体   English

ASP.Net aspxerrorpath = / Login.aspx

[英]ASP.Net aspxerrorpath=/Login.aspx

I recently uploaded my asp.net website to a hosting server. 我最近将我的asp.net网站上传到托管服务器。 But now when I query the URL: http://paracha.net/ it gives me a 404 error. 但是现在当我查询URL: http : //paracha.net/时,出现了404错误。 This 404 error page is rendering from my own specified custom error in Web.config 此404错误页面是从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. 这是我真正尝试在线托管的第一个asp.net网站。 It works great on localhost. 它在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: 下面列出了我的Web.config文件的内容:

<?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: 正如@Manraj所说,我尝试过:

<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. 刷新页面后,我发现SQL Server无法使用默认用户“ sa”登录,因此我很快意识到数据库连接字符串不正确。 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. customErrors会覆盖原始错误详细信息,并同时隐藏堆栈跟踪。 So If you are facing some sort of error try to turn off customErrors then check whats the actual error. 因此,如果您遇到某种错误,请尝试关闭customErrors,然后检查实际错误是什么。

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. 如果不使用任何错误日志,请尝试使用错误日志(例如log4net)并记录异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.net默认login.aspx页缺少图像 - ASP.net default login.aspx page missing images 尝试更改asp.net中默认login.aspx页内的标签文本 - Trying to change the text of a label that is inside the default login.aspx page in asp.net HTTPS仅适用于一个ASP.NET页面(Login.aspx),HTTP始终用于其余站点 - HTTPS for only one ASP.NET page (Login.aspx), HTTP always for rest of site 将ASP.net MVC项目部署到IIS并重定向到login.aspx - Deploy ASP.net MVC project to IIS and redirect to login.aspx asp.net如何知道不对login.aspx应用安全性? 反向代理给我问题 - How does asp.net know not to apply security to login.aspx? Reverse proxy is giving me issues ASP.NET Owin OAuth (Google / Facebook) 正在重定向到远程登录页面的默认 login.aspx insead - ASP.NET Owin OAuth (Google / Facebook) is redirecting to default login.aspx insead of remote log in page 尝试更改默认情况下使用Asp.Net WebForms模板提供的Login.aspx页的母版时发生运行时错误 - Runtime error when attempting to change the Master Page for the Login.aspx page given by default with the Asp.Net WebForms template ASP.NET:登录会话HTML和ASPX - Asp.net: login session html and aspx 具有表单身份验证功能的Silverlight-重定向到login.aspx - silverlight with forms authentification - redirect to login.aspx CSS模板无法与Login.aspx页面一起使用 - CSS template not working with Login.aspx page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM