Hi
I am creating list of checkboxes in partial view by follwoing http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/
code and Rendered HTML for checkboxes is as follows
<%=Html.CheckBox("EmployeeID", new { value = user.EmployeeID, @class = "ccboxes", title = user.Designation + "(" + user.EmployeeName + ")" })%>
<INPUT id=MemoUsers_a29f82e4-ebbc-47b0-8cdd-7d54f94143be__EmployeeID class=boxes title=Programmer(Zia) value=6 type=checkbox name=MemoUsers[a29f82e4-ebbc-47b0-8cdd-7d54f94143be].EmployeeID jQuery1276681299292="27">
<INPUT value=false type=hidden name=MemoUsers[a29f82e4-ebbc-47b0-8cdd-7d54f94143be].EmployeeID>
In rendered html it can be seen that value attribute of hidden field is false. i want to assign explicit value(same as checkbox value) to this value. Is this possible using html.checkbox or html.checkboxfor.
one way is recommended in http://stackoverflow.com/questions/626901/asp-net-mvc-rc2-checkboxes-with-explicit-values. Is there any other better way
i want to do this as ModelState.IsValid is returning false because of hidden field value attribute
Regards
Similar:
- retrieve value from hidden field on asp.net page Hi everyone If anyone could help out an access user who is trying to retrieve the value in a hidden field on an asp.net page...
- How 2 get a value from a hidden field on a web page to a field on a Access form? Hi, I have a access form, which has some text fields on it and a few buttons and a web browser control. How it works:...
- jquery autocomplete on button click get hidden value using jquery autocomplete, we get hidden value by calling .result function like this $("#suggest").result(function(event, data, formatted) { $('#hidden').val(data[1]); }); This is only useful when we...
- Checkbox groups in asp Hi, I ran into a strange problem with checkbox groups. I am trying to get the values from a group of checkboxes, but I have...
- check-box/text field help G’day, Hopefully someone here may be able to help me solve my little dilemma. I have a check box set up, and along side it...
Tags: checkboxes, partial view, style code, variable length