弹窗

public static void RegisterJQueryDialogScript(Page page, string dialogDivId, string title, int width, int height, bool autoOpen, string openTriggerClientId)
{
if (string.IsNullOrEmpty(title))
title = "Form"; var heightStr = string.Empty;
var witdthStr = string.Empty;
if (height > )
heightStr = "height: " + height.ToString() + ",";
if (width > )
witdthStr = "width: " + width.ToString() + ","; string script = @"
$(function ()
{
$('#dialog:ui-dialog').dialog('destroy');
$('#" + dialogDivId + @"').dialog(
{
title: '" + title + @"',
autoOpen:" + autoOpen.ToString().ToLower() + "," +
heightStr +
witdthStr + @"
closeText: 'No',
modal: true,
resizable: false
}
).parent().appendTo('form');
}
);
";
string scriptKey = "Open" + dialogDivId;
if (autoOpen)
ScriptManager.RegisterStartupScript(page, page.GetType(), scriptKey, script, true);
else
{
ScriptManager.RegisterClientScriptBlock(page, page.GetType(), scriptKey, script, true); var scriptTrigger = @"$('#" + openTriggerClientId + @"')
.click(function () {
$('#" + dialogDivId + @"').dialog('open');
return false;
});";
scriptKey += "Trigger";
ScriptManager.RegisterStartupScript(page, page.GetType(), scriptKey, scriptTrigger, true);
}
}

Open a user control in a pop up

webform将一个usercontrol作为模态框在page上弹出的更多相关文章

  1. 整理:手机端弹出提示框,使用的bootstrap中的模态框(modal,弹出层),比kendo弹出效果好

    效果图: 我的代码示例: <!--提示模态框--> <div class="modal fade" id="myModal" tabindex ...

  2. bootstrap中的模态框(modal,弹出层)

    默认的modal示例: <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset= ...

  3. Bootstrap学习5--bootstrap中的模态框(modal,弹出层)

    bootstrap中的模态框(modal),不同于Tooltips,模态框以弹出对话框的形式出现,具有最小和最实用的功能集. 务必将模态框的 HTML 代码放在文档的最高层级内(也就是说,尽量作为 b ...

  4. Bootstrap学习笔记(9)--模态框(登录/注册弹框)

    说明: 1. 上来一个ul先把登录和注册两个链接扔进去,ul的类nav,navbar-nav是导航条,navbar-right让他固定在右侧.每个li的里面,data-toggle="mod ...

  5. 完美解决bootstrap模态框允许拖动后拖出边界的问题

    使用bootstrap3版本 在网上看了很多方法,我觉得jquery-ui的实现方法是最简单有效的,具体实现方法 1.下载并引入jquery-ui插件 2.全局添加模态框允许拖动事件 $(docume ...

  6. bootstrap添加模态窗后,再弹出消息提示框后,原先的滚动条消失

    设置需要滚动的模态框 overflow :scroll

  7. ios11,弹出层内的input框光标错位 键盘弹出时,输入信息,光标一直乱跳

      之前开发了一个微信项目,维护期中苹果手机突然出现光标错位现象,经过排查,发现是最新的ios11系统的锅. 具体情况:弹出层使用position: fixed:弹出层内附带input/textare ...

  8. WPF实战之一 桌面消息框(右下角消息弹出框)

    此版本是根据别人的项目改造的,记录下笔记 原文:https://blog.csdn.net/catshitone/article/details/75089069 一.即时弹出 1.创建弹出框 新建一 ...

  9. layer弹出框确定前验证:弹出消息框(弹出两个layer)

    作者QQ:1095737364 QQ群:123300273 欢迎加入! layer 弹出框中经常遇到要弹出表单进行修改数据, 因此在弹出框中的表单需要验证数据, 就需要在弹出一个layer, 默认的设 ...

随机推荐

  1. MapReduce(3): Partitioner, Combiner and Shuffling

    Partitioner: Partitioning and Combining take place between Map and Reduce phases. It is to club the ...

  2. python self和cls的区别

    1.self表示一个具体的实例本身.如果用了staticmethod,那么就可以无视这个self,将这个方法当成一个普通的函数使用. 2.cls表示这个类本身.

  3. java注解编程@since 1.8

    一.基本元注解: @Retention: 说明这个注解的生命周期 RetentionPolicy.SOURCE -> 保留在原码阶段,编译时忽略 RetentionPolicy.CLASS -& ...

  4. Rest接口单元测试

    Get请求url不超过4000字节 Rest成熟度:level 0:使用http作为传输方式,leve 1:引入资源概念,每个资源有对应的url,level 2:使用http方法进行不同操作,使用ht ...

  5. 解决ubuntu下eth0不显示

    今天电脑重启之后,用ifconfig查看网络地址,就发现eth0神奇的消失了,顿时感觉吓尿了. 按照网上看到的资料,发现输入ifconfig -a 发现可以显示eth0,但是当输入ifconfig就没 ...

  6. 《剑指offer》面试题4 替换空格 Java版

    (给一个足够长的字符数组,其中有一段字符,将' '(空格)替换成'%' '2' '0'三个字符,原字符段由'\0'结尾) 书中方法:这道题如果从头到尾扫描数组并替换,会涉及到数组的移动.如果不移动元素 ...

  7. luoguP1966 火柴排队(NOIP2013)(归并排序)

    luogu P1966 火柴排队 题目 #include<iostream> #include<cstdlib> #include<cstdio> #include ...

  8. var、let、const的区别

    var.let.const的区别 var定义的变量,没有块的概念,可以跨块访问, 不能跨函数访问. let定义的变量,只能在块作用域里访问,不能跨块访问,也不能跨函数访问. const用来定义常量,使 ...

  9. 根据select选择来控div是否显示,默认这个div是隐藏的,

    <!DOCTYPE html><html><head lang="cn"><title>Insert title here</ ...

  10. JS变量连续赋值

    下面就是这个经典案例: var a = {n: 1}; var b = a; a.x = a = {n: 2}; console.log(a);console.log(b); console.log( ...