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>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架