从checkboxlist asp.net中的项目复选框中删除边框

时间:2016-06-08 14:42:33

标签: c# css asp.net

我对删除CheckBoxList中的项目边框并尝试使用CSS border: none有疑问,即便如此,它也无效

函数BindData中的

我从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而我无法移除

enter image description here

目标是输入样式

enter image description here

任何建议?

0 个答案:

没有答案