AlwaysVisibleControl

AlwaysVisibleControl控件用来在页面上显示一个浮动的窗口,通常用它来显示菜单,消息和广告等。

属性列表:
TargetControlID : 控件的ID
HorizontalOffset : 控件距离浏览器的水平边距. 默认是0px。
HorizontalSide : 水平停靠方向。可选择(Left, Center, or Right)。默认是Left
VerticalOffset :控件距离浏览器的垂直边距. 默认是0px。
VerticalSide :垂直停靠方向。可选择(Top, Middle, or Bottom)。默认是Top。
ScrollEffectDuration : 控件复位时间,默认时间是0.1,单位是秒。
ProfileBindings:要绑定个性化配置中的属性。
常见问题以及使用技巧:
在页面刚刚完成加载时,悬浮在页面中的控件位置不正确,在接下来的一次面面闪烁之后,该控件才被固定到期望的正确位置上。
解决方案是把加载位置和特效位置设置相同;把实例中的Panel中的样式引用为此样式并做相应的修改。
    <style type="text/css">
        .login
        {
            background-color: #fff;
            border: 2px solid #000;
            position: absolute;
            left: 10px;
            top: 50px;
        }
    </style>

实例解析一、始终显示的消息窗口

1.UI界面
<form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>   
    </div>
        <asp:Panel ID="Panel1" runat="server" Height="25px" Width="292px">
            你有短消息!
        <asp:Panel ID="Panel2" runat="server" Height="192px" Width="290px">
            <strong><a href="#">查看</a></strong></asp:Panel>
        </asp:Panel>
        <cc1:alwaysvisiblecontrolextender id="AlwaysVisibleControlExtender1" runat="server"
            horizontaloffset="8" horizontalside="Right" targetcontrolid="Panel1" verticaloffset="8"
            verticalside="Middle"></cc1:alwaysvisiblecontrolextender><br/><br/>a<br/><br/>b<br/><br/>
            <br/><br/><br/>c<br/><br/><br/>d<br/><br/>br/><br/><br/><br/><br/><br/>f<br/>e<br/>
             <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>f<br/>e<br/>
    </form>

实例二、简单实现功能
<head runat="server">
    <title>AlwaysVisibleControl Demo</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .login
        {
            background-color: #fff;
            border: 2px solid #000;
            position: absolute;
            left: 10px;
            top: 50px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="sm" runat="server" />
        <asp:Login ID="myLogin" CssClass="login" runat="server">
        </asp:Login>
        <ajaxToolkit:AlwaysVisibleControlExtender ID="avce" TargetControlID="myLogin" HorizontalSide="Right"
            HorizontalOffset="10" VerticalSide="Top" VerticalOffset="50" runat="server" />
        <div>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
            <p>
                AlwaysVisibleControl Demo. AlwaysVisibleControl Demo. AlwaysVisibleControl Demo.
            </p>
        </div>
    </form>
</body>

 

posted @ 2007-11-16 01:54  Astar  阅读(729)  评论(0编辑  收藏  举报