第一次使用asp按钮不会在点击事件上触发服务器端 [英] asp button on first time doesnt fire server side on click event

查看:90
本文介绍了第一次使用asp按钮不会在点击事件上触发服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个asp:按钮,


$ b第一次单击$ b会触发clientclick事件但是在点击事件上没有激活服务器端,因此,由于代码的下一步将数据绑定到组件艺术网格,需要从服务器端onclick执行操作,网页会出错





加载回发数据时出错:System.FormatException:字符串未被识别为有效布尔值。

at System .Boolean.Parse(String value)

在ComponentArt.Web.UI.Grid.GetXmlValues(GridColumnCollection arColumns,XmlNodeList arNodes)

在ComponentArt.Web.UI.Grid。 LoadClientXmlRow(XmlNode oRowNode,GridItemCollection arItems,Int32 iLevel)

在ComponentArt.Web.UI.Grid.LoadClientXmlRows(XmlNodeList arNodes,GridItemCollection arItems,Int32 iLevel)
$ B $在ComponentArt。 Web.UI.Grid.LoadClientData(String sData)

描述:durin发生了未处理的异常g执行当前的Web请求。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。



异常详细信息:System.Exception:加载回发数据时出错:System.FormatException:String未被识别为有效的布尔值。

at System.Boolean.Parse(String value)

在ComponentArt.Web.UI.Grid.GetXmlValues(GridColumnCollection arColumns,XmlNodeList arNodes)

在ComponentArt.Web.UI.Grid .LoadClientXmlRow(XmlNode oRowNode,GridItemCollection arItems,Int32 iLevel)

在ComponentArt.Web.UI.Grid.LoadClientXmlRows(XmlNodeList arNodes,GridItemCollection arItems,Int32 iLevel)

在ComponentArt .Web.UI.Grid.LoadClientData(String sData)







但第二次点击相同的按钮,一切正常,一切都火了,没有错误???我应该怎么做。



我已经尝试将所有文​​本框和其他控件autopostback设置为false。



我也试过给按钮控件一个id。

解决方案

检查第一行你的.aspx页面。



AutoEventWireup =true

CodeFile =Default.aspx.cs Inherits =_ Default%>]]>




确保将AutoEventWireUp属性设置为 True

hi there,

I have an asp:button,

on first time click fires clientclick event but doesnt fire server side on click event and therefore since the next step of the code "binding data to Component art grid", needs the action from Server side onclick, the webpage gives an error


Error loading postback data: System.FormatException: String was not recognized as a valid Boolean.
at System.Boolean.Parse(String value)
at ComponentArt.Web.UI.Grid.GetXmlValues(GridColumnCollection arColumns, XmlNodeList arNodes)
at ComponentArt.Web.UI.Grid.LoadClientXmlRow(XmlNode oRowNode, GridItemCollection arItems, Int32 iLevel)
at ComponentArt.Web.UI.Grid.LoadClientXmlRows(XmlNodeList arNodes, GridItemCollection arItems, Int32 iLevel)
at ComponentArt.Web.UI.Grid.LoadClientData(String sData)
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.Exception: Error loading postback data: System.FormatException: String was not recognized as a valid Boolean.
at System.Boolean.Parse(String value)
at ComponentArt.Web.UI.Grid.GetXmlValues(GridColumnCollection arColumns, XmlNodeList arNodes)
at ComponentArt.Web.UI.Grid.LoadClientXmlRow(XmlNode oRowNode, GridItemCollection arItems, Int32 iLevel)
at ComponentArt.Web.UI.Grid.LoadClientXmlRows(XmlNodeList arNodes, GridItemCollection arItems, Int32 iLevel)
at ComponentArt.Web.UI.Grid.LoadClientData(String sData)



but second time when you click the same button, everything is normal, everything fires and there is no error ??? what should i do.

I have already tried making all textboxes and other controls autopostback to false.

I have also tried giving an id to the button control.

解决方案

Check the first line of your .aspx page.

AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>]]>


Make sure that AutoEventWireUp Attribute is set to True


这篇关于第一次使用asp按钮不会在点击事件上触发服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆