在IE10中点击updatepanel里面的imagebutton时出现的错误:输入字符串的格式不正确( 在 System.Number.StringToNumber)
2013-07-03 16:43
525 查看
问题描述:在IE10中点击updatepanel里面的imagebutton时出现“输入字符串的格式不正确”的错误,在其它浏览器以及IE7/8/9无此问题
异常消息:
在vs中调试时会出现javascript运行时错误:
Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
updatepanel中包含一个grid控件和一个分页控件,在点击分页按钮时出现此问题,代码如下:
解决方法:在所属页面或所在模板页中加入如下脚本即可解决
异常消息:
输入字符串的格式不正确。 在 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) 在 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) 在 System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) 在 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在vs中调试时会出现javascript运行时错误:
Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
updatepanel中包含一个grid控件和一个分页控件,在点击分页按钮时出现此问题,代码如下:
<asp:UpdatePanel runat="server" ID="up" UpdateMode="Conditional"> <ContentTemplate> <asp:DexGrid ID="myGrid" runat="server"> </asp:DexGrid> <asp:DexPagerBar ID="myPager" runat="server" OwnerControlID="myGrid"> </asp:DexPagerBar> </ContentTemplate> <Triggers> </Triggers> </asp:UpdatePanel>
解决方法:在所属页面或所在模板页中加入如下脚本即可解决
<script type="text/javascript"> //为解决在IE10中点击updatepanel里面的imagebutton时出现的错误 Sys.WebForms.PageRequestManager.getInstance()._origOnFormActiveElement = Sys.WebForms.PageRequestManager.getInstance()._onFormElementActive; Sys.WebForms.PageRequestManager.getInstance()._onFormElementActive = function(element, offsetX, offsetY) { if (element.tagName.toUpperCase() === 'INPUT' && element.type === 'image') { offsetX = Math.floor(offsetX); offsetY = Math.floor(offsetY); } this._origOnFormActiveElement(element, offsetX, offsetY); }; </script>
相关文章推荐
- phprcp .net版报错误:System.FormatException: 输入字符串的格式不正确。
- 【出现异常】异常信息为:{"ClassName":"System.FormatException","Message":"输入字符串的格式不正确。。。。。。
- string.Format出现异常:输入字符串的格式不正确 Exception during StringFormat
- string.Format出现异常"输入的字符串格式有误"的解决方法
- string.Format出现异常"输入的字符串格式有误"的解决方法
- 输入字符串的格式不正确(异常详细信息: System.FormatException: 输入字符串的格式不正确。)
- 检查是否输入字符串为正确的EMAIL格式 public String[] split(String regex)
- json格式的字符串使用string.Format()方法报错:输入字符串的格式不正确
- python字符串和变量相加时出现,coercing to unicode need string or buffer nonetype found python 错误的解决
- python字符串和变量相加时出现,coercing to unicode need string or buffer ?? found 错误的解决
- 关于Devexpress xtraGrid中数字字段删除数字后出现输入字符串格式不正确问题的解决方案
- : 尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运行,将出现此问题。 ---> System.BadImageFormatException: 试图加载格式不正确的程序。
- string.Format 异常 输入字符串的格式不正确
- 服务器无法读取请求。 ---> XML 文档(1, 1549)中有错误。 ---> 输入字符串的格式不正确。
- Asp.net 出错:System.FormatException: 输入字符串的格式不正确
- string.Format出现异常"输入的字符串格式有误"的解决方法
- WCF部署时的异常错误“System.BadImageFormatException: 未能加载文件或程序集“GCGL_Service”或它的某一个依赖项。试图加载格式不正确的程序。”
- string.Format出现异常"输入的字符串格式有误"的解决方法
- System.FormatException: 输入字符串的格式不正确---实例解释 (转载)
- 【C#】解决进行反序列化时出错:。InnerException 消息是“反序列化对象 属于类型 System.String 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。