第十五篇: Ajax Control Toolkit 控件包--4.AlwaysVisibleControlExtender

 
  
div>
< asp:UpdatePanel ID ="UpdatePanel1" runat ="server" >
< ContentTemplate >
< asp:Panel ID ="Panel1" runat ="server" Width ="161" Height ="127"
BorderColor
="#C2C2C2" BorderStyle ="Dashed" BorderWidth ="1px" >
< br />
< br />
学习AJAX
< br />
就去playaspx.com
</ asp:Panel >
< cc1:AlwaysVisibleControlExtender ID ="AlwaysVisibleControlExtender1"
runat
="server" TargetControlID ="Panel1" 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 >

 

 
  
protected void DropDownList1_SelectedIndexChanged( object sender, EventArgs e)
{
switch (DropDownList1.SelectedValue[ 0 ].ToString())
{
case " 0 " :
AlwaysVisibleControlExtender1.HorizontalSide
= HorizontalSide.Left;
break ;
case " 1 " :
AlwaysVisibleControlExtender1.HorizontalSide
= HorizontalSide.Center;
break ;
case " 2 " :
AlwaysVisibleControlExtender1.HorizontalSide
= HorizontalSide.Right;
break ;
default :
AlwaysVisibleControlExtender1.HorizontalSide
= HorizontalSide.Center;
break ;
}
switch (DropDownList1.SelectedValue[ 1 ].ToString())
{
case " 0 " :
AlwaysVisibleControlExtender1.VerticalSide
= VerticalSide.Top;
break ;
case " 1 " :
AlwaysVisibleControlExtender1.VerticalSide
= VerticalSide.Middle;
break ;
case " 2 " :
AlwaysVisibleControlExtender1.VerticalSide
= VerticalSide.Bottom;
break ;
default :
AlwaysVisibleControlExtender1.VerticalSide
= VerticalSide.Middle;
break ;
}
}

常用属性:

 1、TargetControlID: 需要保持’悬浮’状态的控件ID.

 2、HorizontalSide: 被控制控件的水平位置,可以为Left, Center,Right,默认值是Left.

 3、HorizontalOffset: 结合上面的horizontalSide来使用,如果horizontalSide为Left,那么把HorizontalOffset设置为10px,表示距离浏览器左边10px。

 4、VerticalSide: 被控制控件的垂直位置,可以为Top,Middle,Bottom。 默认值是Top.

 5、VertivcalOffset: 和上面的VerticalSide结合控制控件距离VerticalSide多少像素。如果VerticalSide设置为Top, VerticalOffset设置为20px,那么表示控件距离Top的距离是20px.

 6、ScrollEffectDuration: 滚动效果周期设置,我不大清楚有什么用处。

 CS代码,引入命名空间 using AjaxControlToolkit;

转载于:https://www.cnblogs.com/net123/archive/2010/01/28/1658784.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值