事件类型: 警告
事件来源: ASP.NET 2.0.50727.0
事件种类: Web Event
事件 ID: 1309
日期: 2010-5-19
事件: 21:44:04
用户: N/A
计算机: HELLOWORLD
描述:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2010-5-19 21:44:04
Event time (UTC): 2010-5-19 13:44:04
Event ID: f53b19b3931d4089bd1e881fdbf1fed8
Event sequence: 20818
Event occurrence: 51
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/383510895/Root-1-129187327752343750
Trust level: Full
Application Virtual Path: /
Application Path: G:\homep5\xd895\
Machine name: HELLOWORLD
Process information:
Process ID: 5208
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: ArgumentException
Exception message: String cannot be of zero length.
Parameter name: oldValue
Request information:
Request URL: http://www.xiangdang.net/ArticalAdd.aspx
Request path: /ArticalAdd.aspx
User host address: 60.173.5.50
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.String.Replace(String oldValue, String newValue)
at ArticalAdd.Button3_Click(Object sender, EventArgs e) in G:\homep5\xd895\
\ArticalAdd.aspx.cs:line 144
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。
这个问题属于ms的经典错误了,要是变w3wp的error的话一般会导致IIS死掉的,但是warn是可以忽略的,有时候一个js错误也会引发该警告的
ArticalAdd.aspx.cs:line 144号是什么呢?
错误提示很清楚
String cannot be of zero length
问题出在 Button3_Click 这个事件处理程序中
String.Replace 这一句 oldValue 你输入了一个空字符串,这是不允许的。你可以在这个之前判断一下oldValue字符串是否为空,如果为空,不要调用 String.Replace.