模块化弹出式扩展器错误 [英] Modular popup extender error
本文介绍了模块化弹出式扩展器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
成功解决了之前的所有问题后,现在卡在了代码的最后一行.那是从母版页开始的:
After successfully solving all the previous issue now im stuck on the final line of code.That is from the master page :
public bool CheckErrors()
{
//Page x=new System.Web.UI.Page();
ValidationSummary sum= new ValidationSummary();
Page.Validate(sum.ValidationGroup);
if (!Page.IsValid)
{
//this.EnsureChildControls();
UpdatePanel update = new UpdatePanel();
update.ID = "update";
update.UpdateMode = UpdatePanelUpdateMode.Conditional;
update.Update();
modalPopupEx.Show();//error is in this line
return false;
}
return true;
}
错误提示对象引用未设置为对象的实例.这是显示弹出窗口的最后一行代码...需要帮助
谢谢
Error say Object reference not set to an instance of an object.This is the last line of code to display the popup...Help needed
Thanks
推荐答案
谢谢,我已经解决了.
应该是
公共布尔CheckErrors()
{
//Page x = new System.Web.UI.Page();
ValidationSummary sum = new ValidationSummary();
Page.Validate(sum.ValidationGroup);
如果(!Page.IsValid)
{
//this.EnsureChildControls();
UpdatePanel更新=新的UpdatePanel();
update.ID =更新";
update.UpdateMode = UpdatePanelUpdateMode.Conditional;
update.Update();
modalPopupEx =新的AjaxControlToolkit.ModalPopupExtender();
modalPopupEx.Show();
返回false;
}
返回true;
}
谢谢大家的时间.
Thanks I have solved it.
It should have been
public bool CheckErrors()
{
//Page x=new System.Web.UI.Page();
ValidationSummary sum= new ValidationSummary();
Page.Validate(sum.ValidationGroup);
if (!Page.IsValid)
{
//this.EnsureChildControls();
UpdatePanel update = new UpdatePanel();
update.ID = "update";
update.UpdateMode = UpdatePanelUpdateMode.Conditional;
update.Update();
modalPopupEx = new AjaxControlToolkit.ModalPopupExtender();
modalPopupEx.Show();
return false;
}
return true;
}
Thank you all for your time.
这篇关于模块化弹出式扩展器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文