AjaxAlwaysVisibleCotrolEtander

AjaxAlwaysVisibleCotrolEtander

通过DropDownList确定UpdatePanel的位置

 UpdatePanel1.ContentTemplate.ace(AlwaysVisibleControlExtender)

              HorizontalOffset:Center//,left,ringht,Center这个位置确定UpdatePanel在页面的上面的位置是水平位置的左侧,右侧,中间

              VerticalOffset:Middle://这个位置确定UpdatePanel页面的中间中间位置,top,Middle,Bottom分别是垂直位置的:顶部,中部,下部,

以上两个属性全用才能发挥效果

Default.aspx.cs

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

    {

        switch (this.DropDownList1.SelectedValue[0])//00的第一个

        {

            case '0':

                acer.VerticalSide = VerticalSide.Top;//垂直位置的顶部

                break; ;

            case '1':

                acer.VerticalSide = VerticalSide.Middle;//垂直位置的中部

                break;

            case '2':

                acer.VerticalSide = VerticalSide.Bottom;// 垂直的低部

                break;

            default :

                acer.VerticalSide = VerticalSide.Middle;//默认在中部

                return;

        }

        switch (this.DropDownList1.SelectedValue[1])//00的第二个,

        {

            case '0':

                acer.HorizontalSide = HorizontalSide.Left;

                break;

            case '1':

                acer.HorizontalSide = HorizontalSide.Center;

                break;

            case '2':

                acer.HorizontalSide = HorizontalSide.Right;

                break;

            default :

                acer.HorizontalSide = HorizontalSide.Center;

                return;

        }

    }

 

Default.aspx

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

 

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

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

<head runat="server">

    <title>Untitled Page</title>

</head>

<body style="text-align: center">

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

        <asp:ScriptManager ID="ScriptManager1" runat="server" />

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

            <ContentTemplate>

                <asp:Panel ID="showPanel" runat="server" BackColor="#80FFFF" BorderColor="#80FFFF"

                    BorderWidth="1px" Height="149px" Width="181px">

                    <br />

                    <br />

                    浪曦视频在线<br />

                    <br />

                    &nbsp;http://bbs.langsin.com</asp:Panel>

                <cc1:AlwaysVisibleControlExtender ID="acer" runat="server" TargetControlID="showPanel" VerticalSide="Middle">

                </cc1:AlwaysVisibleControlExtender>

                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">

                    <asp:ListItem Value="None">默认</asp:ListItem>

                    <asp:ListItem Value="00">左上</asp:ListItem>

                    <asp:ListItem Value="01">上中</asp:ListItem>

                    <asp:ListItem Value="02">右上</asp:ListItem>

                    <asp:ListItem Value="10">中左</asp:ListItem>

                    <asp:ListItem Value="11">中中</asp:ListItem>

                    <asp:ListItem Value="12">中右</asp:ListItem>

                    <asp:ListItem Value="20">左下</asp:ListItem>

                    <asp:ListItem Value="21">下中</asp:ListItem>

                    <asp:ListItem Value="22">右下</asp:ListItem>

                </asp:DropDownList>

            </ContentTemplate>

        </asp:UpdatePanel>

        <div>

            &nbsp;</div>

    </form>

</body>

</html>

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值