一个用AJAX.NET 实现弹出遮盖层的文章,介绍该控件的用法
原文地址:http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx
ModalPopup 描述
ModalPopup 能够使页面以设计对话框模式显示,这样可以阻止使用者不能和页面的其他部分进行交互操作。这个模式可以是任何层的控件,并且他显示在背景层之上,可以使用任何用户自定义的的样式。当这个模式激活的时候,只有这个层的上内容可以进行交互,点击页面的其他的部分是没有任何作用的。当用户完成了和这个模式层的交互后,点击OK/CANCEL能够解除这个对话框模式的内容,并且有选择性的执行自定义代码。这些自定义代码能够很典型的应用在模式对话框下所产生的任何变化。如何需要页面的POSTBACK,只需要简单的通过控制OK/CANCEL按钮来控制POSTBAKC并且刷新。你也可以通过控制X,Y坐标值来控制模式对话框的显示位置。默认情况下,他是居中的,但是如果只有X,Y被设定,那么他也是水平或者垂直居中的。
ModalPopup 的属性
<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server" TargetControlID="LinkButton1" PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="OkButton" OnOkScript="onOk()" CancelControlID="CancelButton" PopupDragHandleControlID="Panel3" />
TargetControlID - 能够激活模式对话框的控件ID
PopupControlID - 显示为模式对话框的控件ID(弹出层的ID)
BackgroundCssClass - 当模式对话框弹出时候的背景CSS
DropShadow - 如果为TRUE,则自动给弹出层加下拉阴影
OkControlID - 能够解除弹出层的控件ID
OnOkScript - 当弹出层是通过按钮OK解除的时候要执行的代码
OkCancelID - 能够退出弹出层的控件ID
OkCancelScript - 当弹出层是通过CANCEL解除的时候要执行的代码
PopupDragHandleControlID - 包含弹出层的标题和头文件的控件ID,用来做拖拽手柄
X - The X coordinate of the top/left corner of the modal popup (the popup will be centered horizontally if not specified) 如果未标注默认为水平居中
Y - The Y coordinate of the top/left corner of the modal popup (the popup will be centered vertically if not specified) 如果未标注默认为垂直居中
偶第一次翻译,肯能会有错误,如发现请指正。
转载请注明。谢谢
|
posted on
2007-06-25 10:33
Thunderdanky
阅读(
1122)
评论()
收藏
举报