我的asp.net网站会在发生错误时记录错误,但有时只会显示发生错误的代码行。有没有办法找出我没有提供行时出现错误的代码行?
我的Global.asax使用以下代码记录错误:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
'Get MemberNumber
Dim MemberNumber As String
MemberNumber = User.Identity.Name.ToString
If Len(User.Identity.Name.ToString) < 1 Then
MemberNumber = "Guest"
End If
' Code that runs when an unhandled error occurs
Dim objErr As Exception = Server.GetLastError().GetBaseException()
Dim ErrorDescription As String = "<b>Error Caught in Page_Error event</b><hr><br>" & _
"<br><b>Member:</b> " & MemberNumber & _
"<br><b>Error in: </b>" & Request.Url.ToString() & _
"<br><b>Source Error:</b><br>" & objErr.Source.ToString() & _
"<br><b>Error Message: </b>" & objErr.Message.ToString() & _
"<br><b>Stack Trace:</b><br>" & _
objErr.StackTrace.ToString()
ErrorDescription = ErrorDescription & "<br /> <br /><b>Form Variables</b>"
For Each x As String In Request.Form
If Trim(Request.Form(x).ToString).Contains("__VIEWSTATE") = False Then ErrorDescription = ErrorDescription & (x & ": ") & Request.Form(x) & "<br />"
Next
'LOG ERROR cms.Application_Error_Log_Add(ErrorDescription中) 结束子
我正在尝试找到发生错误的行:
来源错误: Microsoft.VisualBasic程序
错误消息:输入字符串的格式不正确 堆栈跟踪:
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value,NumberFormatInfo NumberFormat)at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)Form Variables__EVENTTARGET:ctl00 $ ContentPlaceHolder1 $ SchoolQuestions $ ckAdmin __EVENTARGUMENT: ctl00_RadScriptManager1_TSM:;; System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35:en-US:94b8a2b4-5efc-4f4c-9641-d912b698978d:ea597d4b:b25378d2; Telerik.Web.UI,Version = 2010.3.1317.20,Culture = neutral,PublicKeyToken = 121fae78165ba3d4:en-US:4818cc11-a19b-4572-9f4d-207fcad19ad2:16e4e7cd:b7778d6c:e085fe68 __LASTFOCUS: __VIEWSTATE: ctl00 $ ContentPlaceHolder1 $ SchoolQuestions $ ddSchoolID:92 ctl00 $ ContentPlaceHolder1 $ SchoolQuestions $ ckAdmin:on ctl00 $ ContentPlaceHolder1 $ SchoolQuestions $ tMyName: ctl00 $ ContentPlaceHolder1 $ SchoolQuestions $ TLAST: ctl00_ContentPlaceHolder1_SchoolQuestions_tEventID_ClientState:{“enabled”:true,“emptyMessage”:“”,“minValue”:0,“maxValue”:70368744177664} __EVENTVALIDATION:/ wEWQQL + raDpAgLh8t3iBgK25MzWDwL + zrvtDAK7i6q7AwK8i5q7AwKui6a7AwK9i667AwK6i5K7AwK5i567AwK5i5q7AwK7i8a4AwK5i4K7AwK4i5K7AwK / i567AwK5i5K7AwK9i5q7AwK4i4K7AwK8i6a7AwK / i8q4AwK / i5q7AwK9i567AwKui667AwK8i8a4AwK8i667AwK8i567AwK4i5q7AwK9i6a7AwK4i6a7AwK6i6a7AwK6i5a7AwK4i667AwK7i5a7AwK8i6q7AwK5i6q7AwK9i8a4AwK6i8a4AwK5i8a4AwK7i4K7AwK / i6q7AwK / i4K7AwK / i667AwK8i4K7AwK9i5a7AwK9i4K7AwK8i8q4AwK / i5K7AwK / i8a4AwK8i5a7AwKui6q7AwK / i5a7AwK / i6a7AwK4i5a7AwK8i5K7AwK4i6q7AwK9i6q7AwK5i667AwKY7 + DxBgKbn7baCAK / qaGzCwLO8djHDQKroLz / DgLHmuLYBwLdl66XDgKbip7xDmPB2eQq30MMK1HtYTBNYWWD7h + Z
看起来标有“ckAdmin”的复选框导致此错误,但我不知道如何跟踪它。我该如何追踪这个错误或找到这个错误发生的代码行?