ToggleButton is an ASP.NET AJAX extender that can be attached to an ASP.NET CheckBox control. ToggleButton enables the use of custom images to show the state of the CheckBox. The behaviour of the CheckBox is unaffected.
ToggleButton Properties:
1. TargetControlID: - The ID of the CheckBox to modify
2. ImageHeight\ImageWidth :- The height and width of the image
3. CheckedImageUrl :- the URL of the image to show when the toggle button is in the checked state.
4. UncheckedImageUrl: - the URL of the image to show when the toggle button is in the unchecked state.
5. DisabledCheckedImageUrl :- the URL of the image to show when the toggle button is disabled and in the checked state.
6. DisabledUncheckedImageUrl: - the URL of the image to show when the toggle button is disabled and in the unchecked state.
7. CheckedImageOverUrl :- the URL of the image to show when the toggle button is in the checked state and the mouse is over the button.
8. UncheckedImageOverUrl :- the URL of the image to show when the toggle button is in the unchecked state and the mouse is over the button.
9. CheckedImageAlternateText: - the alt text to show when the toggle button is in the checked state.
10. UncheckedImageAlternateText :- the alt text to show when the toggle button is in the unchecked state.
11. CheckedImageOverAlternateText: - the alt text to show when the toggle button is in the checked state and the mouse is over the button.
12. UncheckedImageOverAlternateText:: - the alt text to show when the toggle button is in the unchecked state and the mouse is over the button.
Example:-
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:CheckBox ID="CheckBox1" runat="server" Text="I Like ASP.NET AJAX" /> <asp:ToggleButtonExtender ID="ToggleButtonExtender1" runat="server" TargetControlID="CheckBox1" ImageWidth="19" ImageHeight="19" CheckedImageAlternateText="Check" UncheckedImageAlternateText="UnCheck" UncheckedImageUrl="Images/ToggleButton_UnChecked.gif" CheckedImageUrl="Images/ToggleButton_Checked.gif" />
</div>
</form>
Output:-
ToggleButton Properties:
1. TargetControlID: - The ID of the CheckBox to modify
2. ImageHeight\ImageWidth :- The height and width of the image
3. CheckedImageUrl :- the URL of the image to show when the toggle button is in the checked state.
4. UncheckedImageUrl: - the URL of the image to show when the toggle button is in the unchecked state.
5. DisabledCheckedImageUrl :- the URL of the image to show when the toggle button is disabled and in the checked state.
6. DisabledUncheckedImageUrl: - the URL of the image to show when the toggle button is disabled and in the unchecked state.
7. CheckedImageOverUrl :- the URL of the image to show when the toggle button is in the checked state and the mouse is over the button.
8. UncheckedImageOverUrl :- the URL of the image to show when the toggle button is in the unchecked state and the mouse is over the button.
9. CheckedImageAlternateText: - the alt text to show when the toggle button is in the checked state.
10. UncheckedImageAlternateText :- the alt text to show when the toggle button is in the unchecked state.
11. CheckedImageOverAlternateText: - the alt text to show when the toggle button is in the checked state and the mouse is over the button.
12. UncheckedImageOverAlternateText:: - the alt text to show when the toggle button is in the unchecked state and the mouse is over the button.
Example:-
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:CheckBox ID="CheckBox1" runat="server" Text="I Like ASP.NET AJAX" /> <asp:ToggleButtonExtender ID="ToggleButtonExtender1" runat="server" TargetControlID="CheckBox1" ImageWidth="19" ImageHeight="19" CheckedImageAlternateText="Check" UncheckedImageAlternateText="UnCheck" UncheckedImageUrl="Images/ToggleButton_UnChecked.gif" CheckedImageUrl="Images/ToggleButton_Checked.gif" />
</div>
</form>
Output:-
No comments:
Post a Comment