0

我对这段代码感到沮丧,因为我不知道发生了什么。

我的用户在尝试编辑网络表单上的简单值时偶尔会出现错误(我无法复制它,因为它对我来说很好用):

Server Error in '/cp' Application.

Input string was not in a correct format.

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.FormatException: Input string was not in a correct format.

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: 


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +13908045
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +305
DevExpress.Web.ASPxPopupControl.Internal.PopupWindowClientStateUtils.LoadClientState(PopupWindow window, String state) +288
DevExpress.Web.ASPxPopupControl.ASPxPopupControl.LoadWindowsState(String state) +133
DevExpress.Web.ASPxClasses.ASPxWebControl.LoadPostDataInternal(NameValueCollection postCollection, Boolean raisePostDataEvent) +447
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +1068
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2773

它告诉我发生了异常,但没有告诉我发生在哪里,或者为什么。

将更改保存到存款的弹出框按钮是:

 Protected Sub btnDepPaid_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDepPaid.Click
        Try
            ASPxPopupControl3.ShowOnPageLoad = False
            Dim da As New bsTableAdapters.DepositTableAdapter
            da.UpdateQuery(DepPaid.Text, CustID.Text)

        Catch ex As Exception

        End Try

    End Sub

我正在运行 Elmah,它显示的只是上面的错误 - 但我看不出错误是如何发生的 - 因为根据 Elmah 的说法,DepPaid.Text 和 CustID.Text 具有有效的“字符串”,例如:“65.00”在他们中。

我的沮丧是,错误并没有说明问题出在哪一行,只是“输入字符串的格式不正确” - 我怎样才能让它给我更多信息?

还有什么我可以添加到上面的代码中,以捕获错误发生的位置,或者任何其他可以查明错误实际是什么的信息?

根据 Elmah 的说法,正在输入的是:

艾玛输入法

谢谢,马克

4

0 回答 0