How to rounded corners extenders control in ajax

aswinialuri-19361
Posted by aswinialuri-19361 under ASP.NET AJAX category on | Points: 40 | Views : 745
In asp code:
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Panel ID="Panel1"
runat="server"
Width="200px"
BackColor="#c0c0c0"
ForeColor="#ffffff"
Font-Bold="true"
Font-Size="16px">
<div style="padding: 5px; text-align:center">
You can add ASP.Net Server Controls or content here.
</div>
</asp:Panel>


<asp:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="Panel1"
Corners="All"
Color="#c0c0c0"
Radius="20"></asp:RoundedCornersExtender>
<div class="clear"><br /></div>

<table cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="100">
<asp:Label ID="Label1" runat="server" Text="Set Radius: " Font-Bold="true"></asp:Label>
</td>
<td>
<asp:RadioButtonList ID="RadioButtonList1"
runat="server"
AutoPostBack="true"
RepeatDirection="Horizontal"

CellPadding="4"
CellSpacing="0"
OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
<asp:ListItem Text="2px" Value="2"></asp:ListItem>
<asp:ListItem Text="5px" Value="5"></asp:ListItem>
<asp:ListItem Text="10px" Value="10"></asp:ListItem>
<asp:ListItem Text="20px" Value="20" Selected="True"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2"
runat="server"
Text="Set Corner Style: "
Font-Bold="true">
</asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1"
runat="server"
AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Text="All"></asp:ListItem>
<asp:ListItem Text="Bottom"></asp:ListItem>
<asp:ListItem Text="BottomLeft"></asp:ListItem>
<asp:ListItem Text="BottomRight"></asp:ListItem>
<asp:ListItem Text="Left"></asp:ListItem>
<asp:ListItem Text="None"></asp:ListItem>
<asp:ListItem Text="Right"></asp:ListItem>
<asp:ListItem Text="Top"></asp:ListItem>
<asp:ListItem Text="TopLeft"></asp:ListItem>
<asp:ListItem Text="TopRight"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</contenttemplate>
</asp:UpdatePanel>
</div>
</form>
</body>

In .aspx.cs code:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.SelectedIndex = 0;
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
RoundedCornersExtender1.Corners = (AjaxControlToolkit.BoxCorners)Enum.Parse(typeof(AjaxControlToolkit.BoxCorners), DropDownList1.SelectedValue);

}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
RoundedCornersExtender1.Radius = Convert.ToInt32(RadioButtonList1.SelectedValue);
}

I hope it will help you

Comments or Responses

Login to post response