I have ASP.NET MVC view page that has Checkbox(Active) and a button(Activate).
Here are somethings I want to do:
If the value from the database is True, The checkbox should be Checked and Enabled and so button also should be Enabled.
Else If the value from the database is False, The chekbox should not be Checked and Disabled. And so button should be disabled.
Here is the View Code:
<% using (Html.BeginForm("ActivateUser", "Home", FormMethod.Post, new { id = "frmActivate" }))
{%>
<%= Html.Hidden("pwdEmail")%>
<input type="hidden" id="isLocked" value="<%= ViewData["isLocked"]%>" />
<table><tbody>
<tr><td class="Form_Label"><label for="chkActive">Active</label></td>
<td><%= Html.CheckBox("chkActive", false)%></td> <td><input type="submit" value="Activate" disabled="disabled" /></td></tr>
</tbody></table>
<% } %>
Appreciate your responses.
Thanks