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.
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.