Hide check box from controller-MVC
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
&l开发者_StackOverflow社区t;%= Html.CheckBoxFor(m =>m.IncludeCallWithNoAgents) %>
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) %>
<% } %>
精彩评论