您的位置:首页 > 其它

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);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐