iframe配合JQueryUI dialog实现登录对话框效果
来源:互联网 发布:json 能传两个对象吗 编辑:程序博客网 时间:2024/04/28 13:10
其实里面的对话框是一个iframe,不把他们做到一个页面中主要方便模块式开发,而且可以带来禁用javascript的时候也能打开编辑界面的效果(当然关闭的时候还需要处理一下):
主要代码:把iframe显示为一个模拟对话框:
$("<iframe id='editFrame' src='EditPersonPage.aspx?action=insert' />").dialog({ autoOpen: true, modal: true, title: "新增人员" });
主界面:
<script type="text/javascript">
var insertClick = function(e) {
$("<iframe id='editFrame' src='EditPersonPage.aspx?action=insert' />").dialog({ autoOpen: true, modal: true, title: "新增人员" });
e.preventDefault();
};
var editClick = function(e) {
var editUrl = "EditPersonPage.aspx?action=edit&id=" + $(this).attr("rowid");
$("<iframe id='editFrame'/>").attr("src", editUrl).dialog({ autoOpen: true, modal: true, title: "编辑人员" });
e.preventDefault();
};
$(function() {
$("#linkInsert").click(insertClick);
$("a[action=edit]").click(editClick);
});
function CloseEditPage() {
$("#editFrame").dialog("close");
document.location.reload();
}
</script>
CloseEditPage方法是关闭对话框并且刷新,供编辑对话框调用。
编辑界面中在保存关闭以后调用父窗口的方法:window.parent.CloseEditPage()关闭编辑对话框。
protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "close", "window.parent.CloseEditPage();", true);
}
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "close", "window.parent.CloseEditPage();", true);
}
这个程序在IE6、IE8、Firefox下都运行通过。
http://www.cnblogs.com/rupeng/archive/2011/01/15/1936029.html
- iframe配合JQueryUI dialog实现登录对话框效果
- iframe配合JQueryUI dialog实现登录对话框效果
- me配合JQueryUI dialog实现登录对话框效果
- JQueryUI dialog实现登录对话框效果
- 用JqueryUI的Dialog+IFrame实现仿模态窗口效果
- iframe+dialog实现对话框为iframe
- JqueryUI插件dialog实现遮罩的效果
- JQueryUI实现对话框
- jQueryUI插件实现tabs效果
- jQueryUI插件实现accordion效果
- jqueryui dialog
- 对话框dialog登录之后,Jquery实现页面定时跳转
- 对话框dialog登录之后,Jquery实现页面定时跳转
- jqueryui-example-autocomplete实现自动填充效果
- acitivity dialog 实现对话框
- SWFUpload在JQueryUI的Dialog中无法实现上传功能
- 使用JQueryUI + FreeMarker 实现Div动态DIalog添加和删除
- jQueryUI dialog 修正不能遮盖某些内嵌iframe的bug
- 在switch-case中定义变量时当心被“穿越”
- error C2143: syntax error : missing ';' before 'tag::id' 'BOOL' : redefinition; typedef cannot be ov
- JQuery操作iframe父页面与子页面的元素与方法
- OCJP(1Z0-851) 模拟题分析(五)
- 11款当前主流平板芯片横向对比评测
- iframe配合JQueryUI dialog实现登录对话框效果
- UVa 156 - Ananagrams
- 《毛泽东的军事艺术》读书笔记
- 【转】程序员技术练级攻略
- 大扬声器评测指标
- UML图(九种)
- 我的初梦《梦幻重游》开发记录二
- 网站提速的最佳实践-Best Practices for Speeding Up Your Web Site,来自雅虎开发者网络
- Android开发:一分钟学会使用Logcat调试程序