Alwaysvisiblecontrolextender is a very simple component that can be used without coding. You may not know what alwaysvisiblecontrolextender is, but you must have seen a floating advertisement floating on both sides of the webpage and rolling along with the scroll bar. By the way, alwaysvisiblecontrolextender allows you to easily achieve the same effect
< ASP : Panel Backcolor= "#666666" Forecolor= "# Ffffff" ID= "Panel1" Runat= "Server" Height= "120px" Width= "210px"> This Panel uses alwaysvisiblecontrolextender, so it always floats in one place ......</ASP:Panel> <Ajaxtoolkit:Alwaysvisiblecontrolextender ID= "Alwaysvisiblecontrolextender1" Runat= "Server" Targetcontrolid= "Panel1" Verticalside= "TOP" Horizontalside= "Right" Verticaloffset= "50" Horizontaloffset= "50" Scrolleffectduration= "1"> </Ajaxtoolkit:Alwaysvisiblecontrolextender>
At the same timeCodeFor your reference.
Set targetcontrolid first, of course panel1. Verticalside refers to the vertical dock location. You can choose top, middel, or bottom. Horizontalside refers to the horizontal dock position. You can select left, center, or right. Verticaloffset refers to the vertical margin, which varies with the choice of verticalside. For example, when verticalside = Top, verticaloffset = 50 is 50 pixels away from the top edge of the browser; When verticalside = bottom, verticaloffset = 50 is 50 pixels away from the bottom edge of the browser. Let's test it by yourself. Horizontaloffset is similar to verticaloffset. Scrolleffectduration refers to the sliding delay time. The larger the value, the slower it is to slide, but the smoother it is, the unit is seconds.