写好的页面中的按纽的委托事件无缘无故自动丢失,
比如:
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
}
中的"this.Button1.Click += new System.EventHandler(this.Button1_Click); "会自动消失了,听说这是.net的一个bug,好象装个补丁就可以了.有谁知道修补此bug的补丁是什么?在哪下载?
比如:
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
}
中的"this.Button1.Click += new System.EventHandler(this.Button1_Click); "会自动消失了,听说这是.net的一个bug,好象装个补丁就可以了.有谁知道修补此bug的补丁是什么?在哪下载?
这个没有办法,只能自己注意点.
原因是WebUIValidation.js造成的,找到函数function ValidatorCommonOnSubmit() {
event.returnValue = !Page_BlockSubmit;
Page_BlockSubmit = false;
}
修改WebUIValidation.js如下即可解决问题function ValidatorCommonOnSubmit() {
var result = !Page_BlockSubmit;
event.returnValue = !Page_BlockSubmit;
Page_BlockSubmit = false;
event.returnValue = result;
return result;
}
{
InitWebControl();
} private void InitWebControl()
{
//把自动生成的事件委托全都放在这里,就不会出现事件丢失的烦劳了
this.Load += new System.EventHandler(this.Page_Load); }