Custom Validator Class Question

  • Thread starter Thread starter needin4mation
  • Start date Start date
N

needin4mation

Hi, consider this:

public class Conditional : Page
{
public HtmlInputCheckBox chkActive;
public RequiredFieldValidator frval_DdlInactive;

public override void Validate()
{
// Only check ship address if not same as billing
bool enableInactiveBy = chkActive.Checked ? false:true;
frval_DdlInactive.Enabled = enableInactiveBy;
// Now perform validation
base.Validate();
}
}

Sorry my OOP knowledge is not up to snuff, but how exactly do I make
use of this class now? It compiles, but changes nothing on my page. I
have it inside my webform1 class. I don't know where it should go.
Thank you for helping.
 

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

Back
Top