Reputation: 6792
I have a validator which I can enable or disable using the following javascript:
<script type="text/javascript">
ValidatorEnable($("#<%=validator2.ClientID%>")[0], true);
</script>
How can I set this attribute of the validator using C# in the code behind?
I have tried using the following C# but it didn't work:
validator2.Enabled = true;
What code do I need to use in the code behind to set ValidatorEnable = true
for the Validator2 control? I have researched this on the net but couldn't find how to do this.
Upvotes: 2
Views: 7323
Reputation: 10105
You can change the Validation Group
of the validator in code behind
Upvotes: 1
Reputation: 262979
The property is named Enabled, not Enable
:
validator2.Enabled = true;
Upvotes: 4