CheckBox(复选按钮)/RadioButton(单选按钮)/BulletedList控件
2009-01-09 18:17
483 查看
CheckBox(复选按钮)和RadioButton(单选按钮)一些控件共有的属性
CheckBox
呈现方式-外观:BackColor/BorderColor/BorderStyle/ForeColor/Text/TextAlign(控制文字左右)
自动回传-行为:AutoPostBack(True)/Visible
RadioButton
行为:GroupName(此属性值相同的项才看做一组,否则各自都是一组)
BulletedList控件
和其他的列表控件(比如CheckBoxList)一样,都派生自ListControl类,所以用法以及很多属性也是大同小异的,主要功能就是创建一个无序或者有序(带编号)的列表,他可以直接添加静态项,也可以动态绑定数据
样式:BuletImageUrl(项目符号图像)
添加静态项
行为:DisplayMode(Text/HyperLink/LinkButton)
外观:BulletStyle(NotSet/Numberd/LowerAlpha/UpperAlpha/LowerRoman/UpperRoman/Disc/Circle/Square/CustomImage)
protected void BullentedList_DataBound(object sender, EventArgs e) //如果是HyperLink可能用的到的代码
{
for (int i=0; i<BulletedList.Items.Count; i++)
{
BullentedList.Items[i].Value = "~/write.aspx?id=" + BulletedList.Items[i].Value;
}
}
protected void BulletedList_Click(object sender, BullentedListEventArgs e) //如果是LinkButton可能用的到的代码
{
Response.Write(BulletedList.Items[e.Index].Text);
}
CheckBox
呈现方式-外观:BackColor/BorderColor/BorderStyle/ForeColor/Text/TextAlign(控制文字左右)
自动回传-行为:AutoPostBack(True)/Visible
RadioButton
行为:GroupName(此属性值相同的项才看做一组,否则各自都是一组)
BulletedList控件
和其他的列表控件(比如CheckBoxList)一样,都派生自ListControl类,所以用法以及很多属性也是大同小异的,主要功能就是创建一个无序或者有序(带编号)的列表,他可以直接添加静态项,也可以动态绑定数据
样式:BuletImageUrl(项目符号图像)
添加静态项
行为:DisplayMode(Text/HyperLink/LinkButton)
外观:BulletStyle(NotSet/Numberd/LowerAlpha/UpperAlpha/LowerRoman/UpperRoman/Disc/Circle/Square/CustomImage)
protected void BullentedList_DataBound(object sender, EventArgs e) //如果是HyperLink可能用的到的代码
{
for (int i=0; i<BulletedList.Items.Count; i++)
{
BullentedList.Items[i].Value = "~/write.aspx?id=" + BulletedList.Items[i].Value;
}
}
protected void BulletedList_Click(object sender, BullentedListEventArgs e) //如果是LinkButton可能用的到的代码
{
Response.Write(BulletedList.Items[e.Index].Text);
}
相关文章推荐
- UI控件之RadioButton(单选按钮)&Checkbox(复选按钮)
- 单选RadioButton与复选CheckBox按钮
- Silverlight中利用ListBox特性实现单选按钮组RadioButtonList和复选按钮组CheckBoxList的功能
- 单选按钮--->RadioButton和复选按钮---->checkBox的使用
- [一个星期自学安卓]单选控件RadioButton及复选控件CheckBox
- [置顶] Android--(11)--解读单选(RadioButton)和复选(CheckBox)按钮
- 单选控件RadioButton_复选控件CheckBox
- ASP.NET中 RadioButtonList(单选按钮组),CheckBoxList(复选框组),DropDownList(下拉框),ListBox(列表框),BulletedList(无序列表)的使用前台绑定
- Android用户界面基础之CheckBox(复选按钮)、RadioButton(单选按钮)学习
- 设定下拉列表控件DropDownList,复选按钮CheckBox,RadioButton默认值总结测试
- 设定下拉列表控件DropDownList,复选按钮CheckBox,RadioButton默认值总结测试
- cocos2dx 3.x (单选,多选,复选checkBox按钮的实现) RadioButton
- 设定下拉列表控件DropDownList,复选按钮CheckBox,RadioButton默认值总结测试
- RadioGroup、RadioButton(单选按钮)、CheckBox(多选按钮)和Toast的使用方法
- 用CSS美化checkbox复选按钮和raido单选按钮-适用于移动端
- 单选按钮(RadioButton)与 复选框(CheckBox)的功能与 用法
- Android入门教程二十七之RadioButton(单选按钮)&Checkbox(复选框)
- 单选按钮(RadioButton)与复选框(CheckBox)的功能与用法
- 限制CheckBoxList控件只能单选实现代码及演示动画
- 微信小程序 修改(自定义) 单选/复选按钮样式 checkbox/radio样式自定义