Hey I would love to know what you think while reading my posts. Please comment!.

Asp.Net CheckBoxList missing value attribute

I am working on an asp.net WebSite project, rather than a Web Application project, and copying code from a Web Application project. The code I am copying is part of a system which has been used for many clients, and this process has been done before e.g. copy and past :P However this one is different because of the Website project.

I have noticed a bug, in that the CheckBoxList, on this particular Website project, is not rendering the value attibute. Now this is causing me an unwanted headache!

I need to investigate this more to find out WHY!

In the meantime

I have basically coded a work around by adding the class attibute with the value in there so that I can access it via javascript.

Help me obi-wan

If anyone has any clues, leave a comment please!

Update

After further investigation, it turns out that when creating a new Web Site in .Net 2.0, 3.0 and 3.5, then the value attribute of a checkbox is never created. A .Net 4.0 Web Site will create the value attribute as expected.

About Me

Tim James I'm Tim, a web applications developer from Glasgow, Scotland. Currently working for Kingfisher Systems Ltd, building bespoke systems within the Car Auction industry.

  • C#
  • VB.NET
  • ASP.NET
  • .NET MVC
  • Web API
  • Razor
  • HTML5
  • CSS3
  • jQuery
  • WCF
  • SQL
  • knockout.js
  • Angularjs
  • AJAX
  • APIs
  • SignalR
Why not follow me on twitter? Follow me on Twitter