ASPxPopupControl使用
指定触发弹窗事件--杂项--PopupElementID="触发事件ID"
关闭弹窗--杂项--CloseAction=CloseButton
1.如果需要弹窗在屏幕正中央,设置
杂项----PopupHorizontalAlign和PopupVerticalAlign都为WindowCenter即可
代码
ASPxPopupControl.PopupHorizontalAlign = DevExpress.Web.ASPxClasses.PopupHorizontalAlign.WindowCenter; ASPxPopupControl.PopupVerticalAlign = DevExpress.Web.ASPxClasses.PopupVerticalAlign.WindowCenter;这样就可以了
2.弹窗变为模态窗
行为-----modal为true
///
/// 显示消息提示框
///
///
void showMessage(string message)
{
PopupWindow pw = new PopupWindow(message);
pw.ContentStyle.ForeColor = System.Drawing.Color.Red;//红色
pw.ContentStyle.Font.Size = FontUnit.Large;//字体大小
pw.ShowOnPageLoad = true;//这句要在后台代码中写出来才生效
this.ASPxPopupControl1.Windows.Add(pw);
}
/// 显示消息提示框
///
///
void showMessage(string message)
{
PopupWindow pw = new PopupWindow(message);
pw.ContentStyle.ForeColor = System.Drawing.Color.Red;//红色
pw.ContentStyle.Font.Size = FontUnit.Large;//字体大小
pw.ShowOnPageLoad = true;//这句要在后台代码中写出来才生效
this.ASPxPopupControl1.Windows.Add(pw);
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23109131/viewspace-665985/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23109131/viewspace-665985/