I want to disable the requiredfield validator control for the textbox based on some condition of a variable:
if(var==null)
{
//Activate it
}
else
{
//disable it
}
What code do I need here?
if(var == null)
{
requirefieldvalidator1.Enabled = true;
}
else
{
requirefieldvalidator1.Enabled = false;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.