I am using asp.net mvc. I have generated a view that retrieve all unapproved users in the asp.net membership table. I have put checkboxes next to them for someone to bring up a view. The goal is that someone should be able to check certain checkboxes, hit save and that will go back to asp.net membership and change the IsApprove flag to true for these users.
How do i extract what fields are set as true when i am in the controller class?
here is the view code:
<% using (Html.BeginForm()) {%>
<table id="hor-zebra" border = 2>
<tr><td>User</td><td>Approve</td>
</tr>
<%
MembershipUserCollection membership = (MembershipUserCollection)ViewData["UnapprovedUsers"];
foreach (MembershipUser member in membership)
{
%><tr><td>
<%=Html.Encode(member.UserName) %> </td><td>
<%= Html.CheckBox("Approve:" + member.UserName, false) %>
</td></tr>
<%
}
%>
</table>
<input type="submit" value="Save" /><% } %>
Here is the controller code:
[AcceptVerbs(HttpVerbs.Post)]
public void ApproveUsers(FormCollection formCollection)
{
Console.Write("I have not idea how i can determine which checkboxes are checked");
}