开发者

Disable textbox required field validator control

开发者 https://www.devze.com 2023-02-20 19:06 出处:网络
I want to disable the requiredfield validator control for the textbox based on some condition of a variable:

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消