如果我们遇到更复杂的要求,比如要求在弹出框里显示另外的网址,请看例子。
* * * * *
* 以下代码实现了定时调before的客户端方法:
~~~
@Html.Q().Popup().Text("我是普通弹出框").ContentOrUrl("http://baidu.com").AutoShow()
~~~
效果如下:

* * * * *
扩展:常见方法列表:
|服务端方法名 |说明 |
| --- | --- |
|CloseTime(int time) |信息框自动关闭时间 |
|AsAlert() |转化为带确定按钮的信息框 |
|AsLoading() |转化为进度信息框 |
|AutoShow(bool show = true) |设置是否自动显示 |
|YesCallBack(string yesCallBack) |用户点击确定时候的回调JS函数 |
|ContentOrUrl(string url) |设置弹出框的内容或者地址 |
|AsFrame() |以Frame形式嵌入Url |
|CustomButtons(List<PopupButton> btns = null) |自定义弹出框按钮 |
|Height(int height) |设置弹出框的高度 |
|PositionXXX() |设置弹出框的显示位置,支持八个方向,如:PositionTop() 、PositionRightBottom() |
|ShowShade(bool showShade = true) |设置是否显示遮罩 |
|客户端方法名 |说明 |
| --- | --- |
|show(msg) |显示指定信息的信息框 |
|close() |关闭信息框 |
