views:

528

answers:

1

Hi all,

I have what should be a fairly simple ASP.NET question, and one I thought I had found a workaround for in the past, but this time I'm having no end of bother trying to get a working solution for it.

I have an ASP.NET page with a number of input controls and a series of form validators for them. I wish the page to have separate forms where only some validators are fired by submit button A and others are fired by submit button B. An example would be a site that included a site search box with validation, and a comments section or form to fill in on the same page. When submitting comments you would not want the search validation to fire, and when running a search you would not want the comment form validators to fire.

What I need is a kind of 'validation panel', or separate form tags to enclose these sections in. Can anyone help?

Best Regards, David.

+5  A: 

You can use ValidationGroup property for this.

But don't forget, you can not have more then one form in your asp.net page.

Canavar
Thanks for your help.David.
davemckay
I would suggest linking to the MSDN documentation for ValidationGroups, it's somewhat more usefull:http://msdn.microsoft.com/en-us/library/ms227424.aspx
rusvdw