Home > DeveloperSection > Articles > Ajax Toolkit ToggleButtonExtender Control in ASP.Net

Ajax Toolkit ToggleButtonExtender Control in ASP.Net


AJAX AJAX 
Ratings:
1 Comment(s)
 11460  View(s)
Rate this:

Ajax Toolkit ToggleButtonExtender Control in ASP.Net

ToggleButton is an ASP.NET AJAX extender that can be attached to an ASP.NET CheckBox control. ToggleButton enables the use of custom images instead of tick mark in the CheckBox. The behaviour of the CheckBox is unaffected.

ToggleButton Properties:

TargetControlID - The ID of the CheckBox to modify

Image Height\Image Width - The height and width of the image

CheckedImageUrl - the URL of the image to show when the toggle button is in the checked state.

UncheckedImageUrl - the URL of the image to show when the toggle button is in the unchecked state.

Code:

<%-- ScriptManager control manages client script for AJAX enabled ASP.NET pages.This enables partial-page rendering and Web-service calls.You have to used this if you want to use ajax control--%>

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

 

<%--Add the togglebuttonextender and one checkbox--%>

<cc1:ToggleButtonExtender ID="ToggleButtonExtender1" runat="server" TargetControlID="CheckBox1" UncheckedImageUrl="~/Unchecked.png"

CheckedImageUrl="~/Checked.png" ImageHeight="60" ImageWidth="60">

</cc1:ToggleButtonExtender>

 

<asp:CheckBox ID="CheckBox1" runat="server" Text="Do you want to select?" />

Run the project

Images hide the checkboxes to show the checked and unchecked state.

AjaxControl Toolkit ToggleButtonExtender Control in ASP.Net

 

AjaxControl Toolkit ToggleButtonExtender Control in ASP.Net


update code

By Raghava Reddy on   one year ago
images are not displaying...

Don't want to miss updates? Please click the below button!

Follow MindStick