Thursday, March 22, 2012

Set more than one ValidationGroup to a Button?

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.
MichaelI 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.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"news.microsoft.com" <someone@.somewhere.com> wrote in message
news:eq3UiunPGHA.3848@.TK2MSFTNGP12.phx.gbl...
> 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
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: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"news.microsoft.com" <someone@.somewhere.com> wrote in message
news:eq3UiunPGHA.3848@.TK2MSFTNGP12.phx.gbl...
> 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

0 comments:

Post a Comment