【问题标题】:Error when clicking an image button in Microsoft Edge在 Microsoft Edge 中单击图像按钮时出错
【发布时间】:2019-07-04 17:22:40
【问题描述】:

当我使用最近更新的 Microsoft Edge 时,它​​有以下问题。当我使用 IE、Chrome 等其他浏览器或以前版本的 Microsoft Edge 时,它​​没有它。

当我单击图像按钮时,它显示“输入字符串格式不正确”的错误消息 堆栈跟踪如下:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7488663
   System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) +115
   System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info) +192
   System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +189
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +14
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +690
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743

请帮助并告知问题所在

【问题讨论】:

    标签: asp.net vb.net visual-studio


    【解决方案1】:

    似乎在您的点击事件中,您尝试将页面中的某个值设置为Double 变量,但原始字符串不是有效的数字格式。浏览器的差异可能是由于浏览器使用了不同的语言环境设置(不同的语言环境可能使用., 作为小数分隔符,或者如果数字足够大也可能使用千位分隔符)。

    为了提供更多帮助,我们需要您的代码中与按钮相关的更多详细信息(编辑您的问题以提供更多信息)。

    【讨论】:

    • 我们检查了服务器和PC中的区域设置,没有发现问题。 Edge 是否有自己的语言环境设置?你能告诉它在哪里吗?
    • 该程序已运行多年的更多信息,并且在以前版本的 Edge 中运行良好。
    • 程序是用Visual Studio、ASP和VB开发的,我们正在努力提供相关代码供大家学习,谢谢。
    • 我不知道它是否与不同的语言环境设置有关,这只是我能想到的第一件事,基于为什么从字符串解析为双精度会失败。要了解更多信息,我认为您必须在解析完成之前调试并查看您在服务器端实际获得的值。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-10
    • 1970-01-01
    • 1970-01-01
    • 2014-09-17
    • 2023-04-03
    • 1970-01-01
    相关资源
    最近更新 更多