zoukankan      html  css  js  c++  java
  • AJAXToolkit_ ModalPopupExtender弹出窗中 使用分页方法

    Asp.net页面

    添加引用AjaxControlToolkit

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %>

       <asp:UpdatePanel ID="UpdatePanelPopUpProducts" runat="server">
                                                                       <ContentTemplate>
                           <asp:TextBox ID="tbCustom" runat="server"></asp:TextBox>
                        
                            </ContentTemplate>
                            </asp:UpdatePanel> 
                                <asp:Button ID="btnCustomSearch" runat="server" Text="pop" OnClick="btnCustomSearch_Click" />
                            <AjaxToolkit:ModalPopupExtender ID="mdlPopupCustom" runat="server"   TargetControlID="btnCustomSearch"
                             PopupControlID="pnlPopupCustom" OkControlID="btnOK" CancelControlID="btnClose" BackgroundCssClass="modalBackground"
                                     />
                    <asp:Panel runat="server" ID="pnlPopupCustom" BackColor="White"  >
                       <asp:UpdatePanel runat="server" ID="UpdatepanelSelectCu">
                            <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="btnOK" EventName="Click" />
                                    <asp:AsyncPostBackTrigger ControlID="btnClose" EventName="Click" />
                                </Triggers>
                            <ContentTemplate>      
                             <asp:UpdatePanel runat="server" ID="Updatepanel1">
                             <ContentTemplate>   
                                <uc1:CustomControl ID="CustomControl1" runat="server"  /><!—-有一分页控件 -->
                                  </ContentTemplate>
                             </asp:UpdatePanel> 
                                <asp:Button ID="btnOK" runat="server" Text="确定" OnClick="btnOK_Click"  UseSubmitBehavior="false"/>  
                                <asp:Button ID="btnClose" runat="server" Text="取消" OnClick="btnClose_Click"  UseSubmitBehavior="false"/> 
                        
                                     </ContentTemplate>
                            </asp:UpdatePanel> 
                            </asp:Panel>

    后台页面.cs

    protected void btnCustomSearch_Click(object sender, EventArgs e)
           {
               //this.mdlPopupCustom.Show();
               //this.pnlPopupCustom.Visible = true;
           }
           protected void btnOK_Click(object sender, EventArgs e)
           {
               this.CustomControl1.GetSelectedCustom();
               string name = ((TypeDataEntity)this.CustomControl1.SelectedCustom).Name;
               ////// this.pcePopup.Commit(name);
               if (!string.IsNullOrEmpty(name))
               {
                   PopupControlExtender.GetProxyForCurrentPopup(this.Page).Commit(name);
                   //this.pcePopup.Commit(name);
                   //PopupControlExtender.GetProxyForCurrentPopup(this).Commit(name);
                   //this.pcePopup.Cancel();
                   //this.pcePopup.Commit(this.tbCustom.Text);
                   //this.mdlPopup.Show();
                   this.tbCustom.Text = name;
                   this.mdlPopupCustom.Hide();
                   //this.pnlPopupCustom.Visible = false;
                   //this.mdlPopupCustom.Hide();
               }
           }
     
           protected void btnClose_Click(object sender, EventArgs e)
           {
               //this.pcePopupCustom.Cancel();
               //this.mdlPopup.Hide();
               //this.pcePopup.Cancel();
               //this.pnlPopupCustom.Visible = false;
               this.mdlPopupCustom.Hide();
           }
     

    在页面中点击按钮弹出选择客户窗体,选择客户后 返回主页面asp:TextBox ID="tbCustom"  中显示选中的客户名称

  • 相关阅读:
    C#中实现简单的预警提示功能(语音提示与弹窗提示)
    C#中使用SoundPlayer播放音频文件(wav文件)
    Angular中路由的嵌套-父子路由
    Winform中设置ZedGraph的坐标轴的标题和刻度不显示十次幂
    Angular中使用JS实现路由跳转、动态路由传值、get方式传值
    surprise库官方文档分析(二):使用预测算法
    surprise库官方文档分析(一)
    webpack官方文档分析(三):Entry Points详解
    webpack官方文档分析(二):概念
    webpack官方文档分析(一):安装
  • 原文地址:https://www.cnblogs.com/z_lb/p/2144793.html
Copyright © 2011-2022 走看看