我对删除CheckBoxList
中的项目边框并尝试使用CSS border: none
有疑问,即便如此,它也无效
我从PersonDB.mdf获取所有项目并将其放入checkBoxList
private void BindData() {
string sQuery = "SELECT * FROM [Person] ORDER BY personID";
//
using(SqlConnection connection = new SqlConnection(connectionString)) {
using(SqlCommand cmd = new SqlCommand(sQuery, connection)) {
connection.Open();
using(SqlDataReader sdr = cmd.ExecuteReader()) {
while (sdr.Read()) {
ListItem item = new ListItem();
item.Text = sdr["personName"].ToString();
item.Value = sdr["personID"].ToString();
ListPerson.Items.Add(item);
}
}
connection.Close();
}
}
}
这里我有 asp.net 脚本来创建ID为 ListPerson
的CheckBoxList
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Person.aspx.cs" Inherits="Person" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div>
<asp:CheckBoxList ID="ListPerson" runat="server" CssClass="checkbox">
</asp:CheckBoxList>
</div>
</asp:Content>
并且CheckBoxList
的设计显示为border
而我无法移除
目标是输入样式
任何建议?