0

I created my own ASP.NET MVC CheckBoxList HtmlHelper based on examples I searched on the net. The Helper basically creates multiple checkbox inputs on the page:

<input type="checkbox" name="Item1" value="1" checked>Item1</input>
<input type="checkbox" name="Item2" value="2" >Item2</input>
<input type="checkbox" name="Item3" value="3" >Item3</input>

Can someone give me an idea on how the HtmlHelpers bind the form control values back to the Action Parameters, and for my CheckBoxList above, how do I bind the values back to the Action Parameter?

Thanks!

rro
  • 619
  • 5
  • 22

1 Answers1

3

In short, they don't.

The HtmlHelper methods simply assist in generating Html.

It is the job of ModelBinders (by default DefaultModelBinder) and various value providers to read the incoming form, querystring etc. parameters and bind them to your action parameters.

Ben Foster
  • 34,340
  • 40
  • 176
  • 285