Validate page programmatically

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

How do you set the Page.IsValid property manually?

I need to check if a bunch of radio buttons are set and if none are I want
to display a message that you need to select one.

I just have a ValidateButtons routine that I call when a button is pushed
and it will set a message on the page if none of the buttons are pressed and
I want to set the IsValid property of the page so that my Page.IsValid test
in my submit function will know that there was a validation error.

You can't set it like:

Page.IsValid = false

as that is a readonly property.

Thanks,

Tom
 
This isnt going to answer your question per se but the radio button is used
as a way to require one to be checked. So just use either a radio button
group or individual radio buttons and give them a group name and then set one
to selected in the property window. That way one is always selected. You
can also
 
Back
Top