Disable textbox required field validator control
I want to disable the requiredfield validator control for the textbox based on some condition of a variable:
if(var==null)
{
//Activate it
}
else
{
开发者_Go百科 //disable it
}
What code do I need here?
if(var == null)
{
requirefieldvalidator1.Enabled = true;
}
else
{
requirefieldvalidator1.Enabled = false;
}
精彩评论