您的位置:首页 > 运维架构

AJAXToolkit_ ModalPopupExtender弹出窗中 使用分页方法

2011-08-18 16:41 281 查看
Asp.net页面

添加引用AjaxControlToolkit

<%@RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="AjaxToolkit"%>

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

后台页面.cs

protectedvoidbtnCustomSearch_Click(objectsender,EventArgse)
{
//this.mdlPopupCustom.Show();
//this.pnlPopupCustom.Visible=true;
}
protectedvoidbtnOK_Click(objectsender,EventArgse)
{
this.CustomControl1.GetSelectedCustom();
stringname=((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();
}
}
protectedvoidbtnClose_Click(objectsender,EventArgse)
{
//this.pcePopupCustom.Cancel();
//this.mdlPopup.Hide();
//this.pcePopup.Cancel();
//this.pnlPopupCustom.Visible=false;
this.mdlPopupCustom.Hide();
}

在页面中点击按钮弹出选择客户窗体,选择客户后返回主页面,asp:TextBoxID="tbCustom"中显示选中的客户名称
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐