ModularPopUp没有弹出 [英] ModularPopUp not poping Up

查看:89
本文介绍了ModularPopUp没有弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我放置了一个requiredfieldValidator来进行文本框验证,并放置了ModularPopUpextender来显示消息.验证确实发生,但仅在服务器站点上发生,并且在客户端站点上没有消息(弹出)出现.Asp代码为:

I have placed a requiredfieldValidator for a textbox validation and ModularPopUpextender to show up the message.The validation does occurs but only on the server site and no message(popup)occurs at the client site.The Asp code is:

<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" ShowSummary="true" DisplayMode="BulletList"

        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" DropShadow="true">
                    </asp:ModalPopupExtender>
                    </ContentTemplate>
</asp:UpdatePanel>



母版页中的方法为:



The method in the master page is:

public partial class SiteMaster : System.Web.UI.MasterPage 
{
    
    public bool CheckErrors()
    {
        //Page x=new System.Web.UI.Page();
        ValidationSummary sum= new ValidationSummary();
        Page.Validate(sum.ValidationGroup);//error is in this line
        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;
    }
}



Web表单中的click事件为:



The the click event in the web form is:

protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    {
        SiteMaster master = (SiteMaster)this.Master;
        if (master.CheckErrors())
        {
            GridView2.Visible = false;
            gvsearch.Visible = true;

            string search = txtsearch.Text.ToString();
            gvsearch.DataSource = DataBase2.myProcedureName(search);
            gvsearch.DataBind();
        }
    }



我还设置了控件的变量组:(文本框,RequireFieldValidator和按钮)

谢谢



I have also set the valiadtion group of the controls:(Textbox,RequireFieldValidator and Button)

Thanks

推荐答案

hi @Member 9291223377


由于updatepanel导致您的modalpopup无法显示,
我认为您应该删除updatepanel ,,,

试试吧,,,

否则,您只需设置updatepanel
hi @Member 9291223377


due to updatepanel your modalpopup not display,
i think you should remove updatepanel,,,

try it,,,,

otherwise you just set updatepanel
Childrenastrigger="true"



希望这对您有帮助...



hope this will help you...


这篇关于ModularPopUp没有弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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