December 2007 - Posts

Disabling the Submit Button Until a CheckBox is Checked
18 December 07 03:45 PM | Scott Mitchell

A little over a year ago I created two ASP.NET validation controls that are missing from the ASP.NET Toolbox: CheckBoxValidator and CheckBoxListValidator. As their names imply, these validation controls validate a single CheckBox (ensuring its either checked or unchecked, depending on a property setting) and ensures that a specified minimum number of options are checked from a CheckBoxList. For some reason, the built-in ASP.NET validation controls do not validate against CheckBoxes.

I recently updated the CheckBoxValidator control so that a page developer can optionally associate a Button, LinkButton, or ImageButton with the validator. In such a case, the CheckBoxValidator injects client-side script so that the associated button is disabled when the CheckBox is in the inappropriate check state, and enabled otherwise. The following screen shot illustrates this concept. On the left, the CheckBox is unchecked so the Submit button is grayed out; on the right, the CheckBox has been checked so the Button has become enabled.

You can read more about this enhancement at Disabling the Submit Button Until a CheckBox is Checked. The complete source code and a simple working demo is available here.

Filed under:
ASP.NET Version 3.5's Web.config File
11 December 07 11:18 AM | Scott Mitchell

If you have had a chance to try out Visual Studio 2008, you likely have seen the rather bulky Web.config file Visual Studio generates when creating a new ASP.NET website or when converting an ASP.NET 2.0 website to 3.5. In one of Scott Guthrie's blog entries a commenter named Mike asked Scott for a rundown of the markup in the default Web.config file generated for version 3.5 ASP.NET applications.

I went ahead and created such an article: Dissecting ASP.NET Version 3.5's Web.config File.

Enjoy!

Filed under:
More Posts

Archives

My Books

  • Teach Yourself ASP.NET 4 in 24 Hours
  • Teach Yourself ASP.NET 3.5 in 24 Hours
  • Teach Yourself ASP.NET 2.0 in 24 Hours
  • ASP.NET Data Web Controls Kick Start
  • ASP.NET: Tips, Tutorials, and Code
  • Designing Active Server Pages
  • Teach Yourself Active Server Pages 3.0 in 21 Days

I am a Microsoft MVP for ASP.NET.

I am an ASPInsider.