Reputation: 9289
How can i hide/show a check box based on a value obtained from controller. I am using the given below code for check box
<%= Html.CheckBoxFor(m =>m.IncludeCallWithNoAgents) %>
Upvotes: 1
Views: 335
Reputation: 1038710
Your view model could contain a property which would be set by the controller action and which should indicate whether this checkbox should be shown or not:
<% if (Model.ShouldShowCheckBox) { %>
<%= Html.CheckBoxFor(m => m.IncludeCallWithNoAgents) %>
<% } %>
Upvotes: 3