Ajax 笔记ToggleButton
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 behavior of the CheckBox is unaffected.
CheckBox的另外一种形式,可以使用自定义图片显示CheckBox的状态,CheckBox的其他行为不受影响。
这个控件的属性好像比较多,指定两个图片,分别表示两种状态,可以设定图片的大小
The control above is initialized with this code. The italic properties are optional:
<ajaxToolkit:ToggleButtonExtender ID="ToggleEx" runat="server" TargetControlID="CheckBox1" ImageWidth="19" ImageHeight="19" CheckedImageAlternateText="Check" UncheckedImageAlternateText="UnCheck" UncheckedImageUrl="ToggleButton_Unchecked.gif" CheckedImageUrl="ToggleButton_Checked.gif" />
- TargetControlID - The ID of the CheckBox to modify CheckBox的ID
- ImageHeight\ImageWidth - 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.
- DisabledCheckedImageUrl - the URL of the image to show when the toggle button is disabled and in the checked state.
- DisabledUncheckedImageUrl - the URL of the image to show when the toggle button is disabled and in the unchecked state.
- CheckedImageAlternateText - the alt text to show when the toggle button is in the checked state.
- UncheckedImageAlternateText - the alt text to show when the toggle button is in the unchecked state.
- ImageHeight/ImageWidth - The height and width, respectively, of the image that will be displayed.