Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7866227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:19:45+00:00 2026-06-03T00:19:45+00:00

I am using an asp.net asp:CheckBoxList with RepeatLayout=UnorderedList It has always rendered the output

  • 0

I am using an asp.net asp:CheckBoxList with RepeatLayout=”UnorderedList”

It has always rendered the output as (with some values missing for brevity)

<ul class="checkbox unstyled">
  <li><input type="checkbox" value="17"><label>Label Name</label></li>              
</ul>

but all of a sudden I am getting a span rendered into the list

<ul class="checkbox unstyled">
  <li><span alt="17"><input type="checkbox" value="17"><label>Label Name</label></span></li>                
</ul>

being produced by the following code

<div class="control-group" >                
  <label class="control-label" id="Label2">Available Mailing Lists</label>
    <div class="controls">            
      <asp:CheckBoxList id="chklSubs" runat="server" RepeatLayout="UnorderedList" CssClass="checkbox unstyled"></asp:CheckBoxList>
    </div>
</div>

It’s messing with my CSS and making the list break. Why would I be getting this span and how do I get rid of it?

Side note I am styling with twitter bootstrap.

full output

<ul id="ContentPlaceHolderDefault_override_innerPageOverRide_BoilerplateMainContentPlaceHolder_ctl00_SignUpCtl_4_chklSubs" class="checkbox unstyled">
  <li><span alt="7"><input id="ContentPlaceHolderDefault_override_innerPageOverRide_BoilerplateMainContentPlaceHolder_ctl00_SignUpCtl_4_chklSubs_0" type="checkbox" name="ctl00$ctl00$ctl00$ContentPlaceHolderDefault$override$innerPageOverRide$BoilerplateMainContentPlaceHolder$ctl00$SignUpCtl_4$chklSubs$0" value="7"><label for="ContentPlaceHolderDefault_override_innerPageOverRide_BoilerplateMainContentPlaceHolder_ctl00_SignUpCtl_4_chklSubs_0">Energy Express Newsletter</label></span></li>
</ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:19:46+00:00Added an answer on June 3, 2026 at 12:19 am

    If you put any CssClass or other attribute on the control, the checkbox will be nested into a span. If you disable the checkbox control for instance within your code the ‘disabled’ attribute is set on the span-tag. I notices it because jQuery couldn’t remove this attribute using the input-selector (only not working in IE).

    This does work in all normal browsers so try this one:

    $("div#" + value + " input:checked").removeAttr('disabled');
    

    This you have to add to let it work in IE:

    $("div#" + value + " span").removeAttr('disabled');
    

    Take a look here:
    C# asp.net: How to remove span tag from WebControl when rendered

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET MVC + jQuery : I need to use some values owned by
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
I am using ASP.NET checkboxlist control. On the page I have a hyperlink. On
I am using CheckBoxList control of Asp.Net. In order to get selected checkboxes i
Using ASP.NET MVC and Entity Framework, I encounter some attach/detach errors when I need
Using ASP.Net MVC 1.0 I have a form with some input control on it.
I´m using ASP.NET 4.0 and testing the ASP.NET XHTML compatibility with some components and
I'm using ASP.NET and C#. I'm programmtically creating a checkboxlist. When I check an
I modified asp.net checkboxlist using css. It hides input using display:none and I'm able
Using ASP.Net, VB.Net In my web page, i have the textbox values when i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.