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/>
Learning Ajax <br/>
Go to playaspx.com </ASP: Panel>
<PC3: alwaysvisiblecontrolextender id = "alwaysvisiblecontrolextender1"
Runat = "server" targetcontrolid = "Panel1" verticalside = "Middle">
</PC3: alwaysvisiblecontrolextender>
<Asp: dropdownlist id = "dropdownlist1" runat = "server" autopostback = "true"
Onselectedindexchanged = "dropdownlist1_selectedindexchanged">
<Asp: listitem value = "NONE"> default </ASP: listitem>
<Asp: listitem value = "00"> top left </ASP: listitem>
<Asp: listitem value = "01"> middle left </ASP: listitem>
<Asp: listitem value = "02"> bottom left </ASP: listitem>
<Asp: listitem value = "10"> upper </ASP: listitem>
<Asp: listitem value = "11"> medium </ASP: listitem>
<Asp: listitem value = "12"> lower </ASP: listitem>
<Asp: listitem value = "20"> top right </ASP: listitem>
<Asp: listitem value = "21"> middle right </ASP: listitem>
<Asp: listitem value = "22"> bottom right </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;
}
}
Common attributes:
1. targetcontrolid: ID of the control that needs to be in the 'Pending' state.
2. horizontalside: horizontal position of the controlled control, which can be left, center, or right. The default value is left.
3. horizontaloffset: used in combination with the preceding horizontalside. If horizontalside is left, set horizontaloffset to 10px, indicating that it is 10 PX away from the left side of the browser.
4. verticalside: the vertical position of the controlled control, which can be top, middle, or bottom. The default value is top.
5. vertivcaloffset: It is used with verticalside to control the number of pixels between the control and verticalside. If verticalside is set to top and verticaloffset is set to 20 PX, the distance between the control and top is 20 PX.
6. scrolleffectduration.
CS code, introduce the namespace using ajaxcontroltoolkit;