------------------------------------------------------------------------------------------
指定触发弹窗事件--杂项--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
/// <summary>
/// 显示消息提示框
/// </summary>
/// <param name="message"></param>
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);
}
-----------------------------------------------------------------------
/// 显示消息提示框
/// </summary>
/// <param name="message"></param>
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);
}
本文详细介绍了如何在网页中使用弹窗,并展示了如何将弹窗设置为模态窗,确保其在屏幕中央显示。通过设置弹窗属性,如PopupHorizontalAlign和PopupVerticalAlign为WindowCenter,可以实现弹窗居中。此外,文章还演示了如何创建并显示包含特定信息的消息提示框,以及如何使其成为模态窗,阻止用户在关闭之前进行其他操作。
416

被折叠的 条评论
为什么被折叠?



