ASP.NET更新面板无法访问

时间:2012-10-19 15:02:43

标签: asp.net ajax

我有一个包含注册详情的网页表单。我在同一页面的更新面板中有一个提交按钮。如果用户没有输入任何内容并单击“提交”按钮,则应对表单的所有必填字段进行验证,并显示一条消息,显示缺少哪些字段。

只要输入提交按钮而不输入任何内容,它就会进行验证但是会抛出一个执行:

  

Microsoft JScript运行时错误:Sys.InvalidOperationException:可以   找不到带有ID的UpdatePanel   'ctl00_ContentPlaceHolder_Content_UpdatePanel_Submit'。如果是的话   动态更新然后它必须在另一个UpdatePanel内。

我的带提交按钮的更新面板变得不可见。代码是:

<asp:UpdatePanel ID="UpdatePanel_Submit" runat="server" UpdateMode='conditional'>
        <ContentTemplate>
            <div style="font-size: 12pt; width: 938px; margin-top: 5px; border-top: ridge 2px gray;">
                <div style="margin-top: 10px; width: 938px;">

                    <asp:Button ID="btn_submit" runat="server"  ToolTip="Click here to submit your request." 
                    Text='Submit Request' onclick="btn_submit_Click" />

                    <asp:LinkButton ID="btn_cancel" runat="server" ToolTip=''>Cancel</asp:LinkButton></span>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

如何防止我的更新面板隐身?