Tuesday, December 11, 2007

Validation Controls for Part of a Page in ASP.NET

If there's a set of controls on the page that requires validation, but some other action that may happen that does not require validation (perhaps there's a search box that's part of a MasterPage, but that exists on a page with an email form that should have some validation), set the ValidationGroup property on the validation controls and the button that should fire them to the same value.

Thanks to a co-worker for pointing this out to me before I had to think too hard about it!

No comments: