开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜