小弟用C#。NET2005做的网络程序,在本地机器上运行,没有一点问题,但是一上传,只要一请求这个页面,就会立刻出现这中错误跪求达人指点,在线等......
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------运行时错误
说明: 服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。 详细信息: 若要使他人能够在远程计算机上查看此特定错误信息的详细信息,请在位于当前 Web 应用程序根目录下的“web.config”配置文件中创建一个 <customErrors> 标记。然后应将此 <customErrors> 标记的“mode”属性设置为“Off”。
<!-- Web.Config 配置文件 --><configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
注释: 通过修改应用程序的 <customErrors> 配置标记的“defaultRedirect”属性,使之指向自定义错误页的 URL,可以用自定义错误页替换所看到的当前错误页。
<!-- Web.Config 配置文件 --><configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------运行时错误
说明: 服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。 详细信息: 若要使他人能够在远程计算机上查看此特定错误信息的详细信息,请在位于当前 Web 应用程序根目录下的“web.config”配置文件中创建一个 <customErrors> 标记。然后应将此 <customErrors> 标记的“mode”属性设置为“Off”。
<!-- Web.Config 配置文件 --><configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
注释: 通过修改应用程序的 <customErrors> 配置标记的“defaultRedirect”属性,使之指向自定义错误页的 URL,可以用自定义错误页替换所看到的当前错误页。
<!-- Web.Config 配置文件 --><configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
解决方案 »
- .net 关于URL 重新高手请进在线等候
- 两个关于asp.net MVC的问题
- 关于Javascript的问题。
- <%# 在SQL的字段里面,有个"公司简介"在里面请问要用什么数据类型 %>
- 关于URL重写,固定IE地址栏的问题
- 请问在web中如何画曲线图,谢谢
- 请问关于“Cache” 的共享域问题!!
- 怎么连接MYSQL数据库
- OnSelectedIndexChanged="headpic_change"为什么<dropdownlist>的这个事件不执行。
- SESSION 过期时间问题
- textbox中的内容提交给sql时,如何保持其中的回车和空格等格式?图片如何插入文章中?
- 怎样用c#.net来生成一个100.js文件?
<customErrors mode="Off"/>再把这个 Web.Config 文件上传到网上去。
再查看一下产生的详细错误。
看了才知道具体是什么错误原因
<customErrors mode="Off"/>
mode=Off,查看具体的错误代码
达人帮我分析一下
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/> <authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace. <customErrors mode="off" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
<customErrors mode="Off"/>
</system.web>
</configuration>
这里是区分大小写的,请改成:<customErrors mode="Off"
<customErrors mode="off" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
先注释掉,这样应该可以出现错误提示.
比如
Response.Redirect(@"/Myproject/a.aspx");
可以改为
Response.Redirect("a.aspx");
或
Response.Redirect("/"+Request.ApplicationPath+"/a.aspx");
protected void Button2_Click(object sender, EventArgs e)
{
if (txtUserName.Text == "******" && txtUserPwd.Text == "******" || txtUserName.Text == "******" && txtUserPwd.Text == "******")
{
Response.Redirect("resourceMan.aspx");
}
else
{
Response.Redirect("zhjy.aspx");
}
}
1。有没有把BIN放在根目录?
2。Web.config有没有放在根目录?
没有生成BIN啊web.config是放在根目录下的