Set more than one ValidationGroup to a Button?

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

ASP.NET 2.0

Is it possible to set more than one ValidationGroup to a Button?

I have two sets of controls on a Web page, into two different
ValidationGroups. I would like when the user clicks on a specific button,
that both groups be validated.

Thanks.
Michael
 
C

Christopher Reed

I don't see any way of this directly using the .NET 2.0 Framework. I'm
sure, given the time, you could come up with a custom Button object and
custom Validation object that could handle it.

Another option could be to use the CustomValidator object. It provides with
both server and client validation functionality, but I'm not how complex it
might be with your validation needs. It's at least worth a look.
 
P

Peter Blum

With validation groups in ASP.NET 2.0, you can only match a button to one
group name.

Just so you know that the option exists, my replacement for the Microsoft
validators, "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) offers validation groups with the
extensions that you need. You can use "*" in the button's Group property to
fire all validation groups. Similarly, the ValidationSummary can have a
group name of "*" to show all validators on the page, if you like.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top