这个控件非常好用……哈哈,有些时候,我们需要在系统中显示一些信息,又不希望这些信息通过页面滚动而不能在页面固定展示,例如广告……哈哈,所以就可以用这个控件了……
AlwaysVisibleControl的用法也是很简单,首先在页面放一个AlwaysVisibleControl控件,然后设置它的TargetID为要一直显示的控件,例如一个Panel的ID,这样就可以,如果你需要,还可以设置它的停靠位置,上下左右还是居中,全都是你说了算……
放代码吧:
<
asp:Panel ID
=
"
LeaveMessage
"
runat
=
"
server
"
Width
=
"
250px
"
BackColor
=
"
White
"
ForeColor
=
"
DarkBlue
"
BorderWidth = " 2 " BorderStyle = " solid " BorderColor = " DarkBlue " Style = " z-index: 1; " >
< div style = " width: 100%; height: 100%; vertical-align: middle; text-align:left; " >
< p >
给我留言: </ p >
& nbsp; & nbsp; & nbsp; < asp:TextBox runat = " server " />
< input type = " button " value = " 确定 " />
< p ></ p >
</ div >
</ asp:Panel >
< ajaxToolkit:AlwaysVisibleControlExtender ID = " avce " runat = " server " TargetControlID = " LeaveMessage "
VerticalSide = " Bottom " VerticalOffset = " 0 " HorizontalSide = " Right " HorizontalOffset = " 0 "
ScrollEffectDuration = " .1 " />
BorderWidth = " 2 " BorderStyle = " solid " BorderColor = " DarkBlue " Style = " z-index: 1; " >
< div style = " width: 100%; height: 100%; vertical-align: middle; text-align:left; " >
< p >
给我留言: </ p >
& nbsp; & nbsp; & nbsp; < asp:TextBox runat = " server " />
< input type = " button " value = " 确定 " />
< p ></ p >
</ div >
</ asp:Panel >
< ajaxToolkit:AlwaysVisibleControlExtender ID = " avce " runat = " server " TargetControlID = " LeaveMessage "
VerticalSide = " Bottom " VerticalOffset = " 0 " HorizontalSide = " Right " HorizontalOffset = " 0 "
ScrollEffectDuration = " .1 " />
解说一下,一个Panel,一个AlwaysVisibleControl,两个控件,Panel不在这次的介绍范围,直接看AlwaysVisibleControl。
ID和runat属性是必须的……
TargetControlID:目标控件的ID,就是一直要显示的控件ID,这里设置的是Panel的ID。
Verticalside:纵向停靠的位置
VerticalOffset:偏移量,单位是px
HorizontalSide:横向停靠位置
HorizontalOffset:偏移量,单位是px
ScrollEffectDuration:重新定位目标控件位置的时间间隔,默认值为0.1s
本文转自齐师傅博客园博客,原文链接:http://www.cnblogs.com/youring2/archive/2011/04/22/2025354.html,如需转载请自行联系原作者