码迷,mamicode.com
首页 > Web开发 > 详细

asp.net弹出层扩展研究

时间:2014-12-11 22:33:54      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:asp.net   弹出层   

bubuko.com,布布扣bubuko.com,布布扣bubuko.com,布布扣bubuko.com,布布扣

.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
    }
}
效果如下:

bubuko.com,布布扣bubuko.com,布布扣

asp.net弹出层扩展研究

标签:asp.net   弹出层   

原文地址:http://blog.csdn.net/yayun0516/article/details/41872191

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!