网上很少对关闭DevExpress ASPxPopupControl 对话框有较为详细的介绍,下面是本人在DX14.1及VS2010 /2012环境下测试成功的代码,以供碰到类似问题的同行参考;下述代码放在弹出对话框的aspx对应代码中:
在客户端关闭对话框JS代码如下:
function ClosePopDialog(){
window.parent.popup.Hide() ;
}
假设采用某个设定的关闭按钮,其OnClick在C#中代码如下:
string csname = "testscript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsStartupScriptRegistered(cstype, csname))
{
string cstext = "window.parent.popup.Hide() ;";
cs.RegisterStartupScript(cstype, csname, cstext, true);
}