当前位置:编程学习 > C#/ASP.NET >>

关于asp.net程序运行问题

写了一个asp.net的程序。
但是在用户登录页面中输入用户名和密码后,页面总是出现如下情况:
Server Error in '/cs' Application.
--------------------------------------------------------------------------------

Runtime Error 
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
 

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

已经将 <customErrors mode="Off"/>修改了,无论如何修改web.config这个文件,都还是出现这个问题,是怎么回事呢?
在本机上测试程序通过,但是移植到服务器上就出现了这个问题。

 
--------------------编程问答-------------------- 你得把customErrors mode="Off" 才能看到错误
--------------------编程问答-------------------- 刚出来的时候,我也是和经理这样说,本地测试没有问题,网上就有问题,你知道他是怎么根我说的!

他说:下次我不想在听到什么本地测试没有问题,一放到网上就有问题,请你处理好了在告诉我。你用的时间就没有关系,问题你总不能和我说,本地测试没有问题,网上就出了问题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

你这个异常:应该和你的URL重写映射有关吧。 --------------------编程问答-------------------- 设为Off看一下具体是什么错误吧,再者看一下网站服务器的配置是不是和你的本地服务器配置一样呢,比如.net framework版本等是不是一致啊 --------------------编程问答--------------------
引用 1 楼 s208ping 的回复:
你得把customErrors mode="Off" 才能看到错误
--------------------编程问答-------------------- 唉,已经把customErrors mode="Off" 设了,不显示任何错误。
framework版本也一样 --------------------编程问答-------------------- 还是IIS配置问题,检查IIS配置
目录权限问题,目录要求有network service用户权限 --------------------编程问答-------------------- 目录权限问题,目录要求有network service用户权限
请问这个在哪里设? --------------------编程问答-------------------- 服务器上运行本程序,错误如下:
Server Error in '/cs' Application.
--------------------------------------------------------------------------------

The ConnectionString property has not been initialized. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[InvalidOperationException: The ConnectionString property has not been initialized.]
   System.Data.SqlClient.SqlConnection.Open() +433
   CPMS.index.Btn_login_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\CS\index.aspx.cs:57
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573  --------------------编程问答-------------------- 还在用.NET 1.1啊?
看似数据库连接字符串的问题啊。 --------------------编程问答-------------------- 数据库连接字符串应该没问题,因为在本地测试是没问题的啊 --------------------编程问答-------------------- 写个try catch 抛出错误,找到错误的根源,改 --------------------编程问答--------------------
  应该是iis设置asp.net版本的问题,你可以检查下,以前貌似也遇到过类似的问题。 --------------------编程问答-------------------- 还是没找到原因,皑皑
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,