asp.net弹出层扩展研究

.aspx代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="popup.aspx.cs" Inherits="lesson_code_Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

<style type ="text/css">

.pnlPopup { padding:10px; border:1px solid gray; background-color:#eaeaea;}

</style>

</head>

<body>

<form id="form1" runat="server">

<div>

<myatk:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

</myatk:ToolkitScriptManager><%--必要的--%>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<myatk:PopupControlExtender ID="TextBox1_PopupControlExtender" runat="server"

DynamicServicePath="" Enabled="True" ExtenderControlID=""

TargetControlID="TextBox1"

PopupControlID="Panel1"

Position="Bottom"

><%--TargetControlID="TextBox1" 控制方

PopupControlID="Panel1" 弹出方

Position="Bottom"这三个属性的含义要明白--%>

</myatk:PopupControlExtender>

<asp:Panel ID="Panel1" runat="server" CssClass ="pnlPopup">

<p>静态弹出层</p>

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">

<ContentTemplate>

<asp:RadioButtonList ID="rblist_1" runat="server" AutoPostBack="True"

onselectedindexchanged="rblist_1_SelectedIndexChanged">

<asp:ListItem >111</asp:ListItem>

<asp:ListItem >222</asp:ListItem>

<asp:ListItem >333</asp:ListItem>

<asp:ListItem >444</asp:ListItem>

</asp:RadioButtonList>

</ContentTemplate>

</asp:UpdatePanel>

</asp:Panel>

</div>

</form>

</body>

</html>

.aspx.cs代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class lesson_code_Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void rblist_1_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox1_PopupControlExtender.Commit(rblist_1.SelectedValue);//构建返回值的方法commit
    }
}

效果如下:

时间: 2024-08-07 04:32:54

asp.net弹出层扩展研究的相关文章

asp.net弹出层实例

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestASPNetNewBlock._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www

ASP.NET—013:实现带控件的弹出层(弹出框)

在页面中用到弹出新页面的情况比较多的,一般来说都是使用JS方法showModalDialog("新页面相对路径+?参数1&参数2",window,"新页面样式");然后会新弹出一个模态的page页.而在有些时候,仅仅是显示一些单一的.少量的数据,或者一些简单的操作时.就没必要使用新弹出页面了.此时,最好使用弹出层,也就是数据还是显示在当前页面的某个控件上,然后通过JS方法实现达到弹出的目的.看下面的例子: <html xmlns="http:

asp.net中获取Layer弹出层返回值

1.MainPage.aspx中点击按钮利用Layer弹出层,代码如下: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="demo.MainPage" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xh

jQuery点击自身以外地方关闭弹出层

$(function(){ $(document).bind("click", function (e) { if($(e.target).closest("#txt").length>0){ $("#tip").show(); }else{ $("#tip").hide(); } }); }); closest会首先检查当前元素是否匹配,如果匹配则直接返回元素本身.如果不匹配则向上查找父元素,一层一层往上,直到找到匹配

jQuery 插件开发——PopupLayer(弹出层)

导读:上次写了一篇关于GridView的插件开发方法,上几天由于工作需要,花了一天左右的事件封装了popupLayer(弹出层)插件.今天有时间就记录一下自己的开发思想与大家分享下,同时也算是对这段时间的工作概要吧. 就我在开发过程中的理解和开发的经验,一般常用的弹出层有三类(其实还有一类就是弹出可以输入内容的,但是这种可以被替代,所以就特别拿出来写了):Confirm.Alert.LoadContent(url).其中Alert又可以分成五种(当然也可以是四种),分别是: "error&quo

分享一个JQuery弹出层插件

JQuery插件TipsWindown 1.1 一个基于jQuery的弹出层.支持拖拽,支持内容为文字,图片,URL等!至于兼容性.在IE6下,弹出对像无法绝对固定.其他应该没啥大问题: 最新更新:(2010-08-12):修正IE6下不能遮住下拉菜单的BUG,增加拖动时半透明效果.句容市鄂茂钢铁 应用演示 弹出文本信息提示:   我是下拉菜单 tipsWindown("提示","text:提示信息内容","250","150"

用jQuery解决弹出层的问题

在BS 项目中 经常需要用到这种弹出层.做这种弹出层一般都会遇到下面几个问题:0,弹出层必须定义在input的下边显示.1,点击input弹出div层.2,点击div层外面任何地方,关闭div层.3,ie6下,div层与下拉框的优先级问题. 下面这个例子就是解决这些问题的,大家可以参考参考,有什么更好的解决方案,请留言. 超级简单版 演示:http://cssrain.cn/demo/popDiv/easyPopDiv.html 实例版 演示:http://cssrain.cn/demo/pop

jquery制作弹出层带遮罩效果,点击阴影部分层消失

jquery制作弹出层带遮罩效果,点击阴影部分层消失. 整体还是比较简单的. HTML代码很简单 1 <a href="#" class="big-link" data-reveal-id="myModal" data-animation="fade">jquery点我弹出</a> 2 <div id="myModal" class="reveal-modal&quo

一个基于jQuery的弹出层插件XYTips

效果预览:http://www.juheweb.com/js/tc/80.html 标签: jQuery [1].[代码] [JavaScript]代码 跳至 [1] ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58