Web配置文件有问题 [英] Problem with web configuration file

查看:82
本文介绍了Web配置文件有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net网站,当我在服务器中托管它时,无法重定向到我的索引页面。

我正在使用此代码..



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..

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







并提到这个也是






and mentioned this also

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





请帮我解决一下......



please help me with a solution...

推荐答案

您设置
<customerrors mode="off"></customerrors>



CustomErrors的简要说明 mode


A brief explaination for CustomErrors mode:

Quote:

有三种错误模式哪个ASP.NET应用程序可以工作:



1)关闭模式

2)开启模式

3 )RemoteOnly模式



错误模式属性确定是否显示ASP.NET错误消息。默认情况下,模式值设置为RemoteOnly。

关闭模式



当error属性设置为Off时,如果出现错误,ASP.NET会为本地和远程用户使用其默认错误页面。

On模式



如果是在模式中,ASP.NET使用用户定义的自定义错误页面而不是本地和远程用户的默认错误页面。如果未指定自定义错误页面,ASP.NET将显示描述如何启用远程查看错误的错误页面。

RemoteOnly



ASP.NET错误页面仅显示给本地用户。远程请求将首先检查自定义错误页面的配置设置或最终显示IIS错误。

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.





参考链接: ASP.NET中的自定义错误 [ ^ ]



请更改您的模式到正确的。



祝你好运,

OI



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

Please change your mode to the proper one.

Good luck,
OI


这篇关于Web配置文件有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆