在母版页中访问方法时出错 [英] Error when accessing method in master page
本文介绍了在母版页中访问方法时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在master中调用消息,但是所调用的方法内发生错误.
方法是:
Im trying to call a message in master but a error occurs within the method called.
The method is:
public bool CheckErrors()
{
ValidationSummary sum= new ValidationSummary();
Page.Validate(sum.ValidationGroup);/
if (!Page.IsValid)
{
update.Update();/error is in this line
modalPopupEx.Show();
return false;
}
return true;
}
asp.net中的更新面板如下:
The update panel in asp.net is like:
<asp:UpdatePanel ID="update" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="errorsPanel" runat="server" Height="41px"
style="margin-left: 54px; margin-top: 144px" Width="812px" BackColor="White">
<div style="text-align: left">
<asp:ValidationSummary ID="valSummary" runat="server"
DisplayMode="BulletList" ShowSummary="true"
ValidationGroup="valGroup" />
<div style="text-align: right">
<asp:Button ID="okBtn" runat="server" Text="Ok" /></div>
</div>
</asp:Panel>
<asp:Label ID="invisibleTarget" runat="server" Style="display: none" />
<asp:ModalPopupExtender ID="modalPopupEx" runat="server" PopupControlID="errorsPanel"
TargetControlID="invisibleTarget" CancelControlID="okBtn" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
它说未将对象引用设置为对象的实例.这意味着更新面板为空.我该如何解决此错误.需要帮助
谢谢
It say that Object reference not set to an instance of an object.meaning that update panel is null.How can i go about solving this error.Help needed please
Thanks
推荐答案
我自己解决了.谢谢大家的辛苦
I solved it myself.Thanks you all fro your effort
这篇关于在母版页中访问方法时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文