vendredi 30 septembre 2016

C# MVC 5 - Make Html.CheckBox() render the hidden input first and then the checkbox input

As we all might know the data Htmlhelper Html.CheckBox(m => m.SomeField) renders two input fields:

<input id="Model_SomeFields" name="Model_SomeFields" type="checkbox" value="true">
<input name="Model_SomeFields" type="hidden" value="false">

Can I somehow manipulate the order so that the hidden field is rendered first?

I want this HTML output:

<input name="Model_SomeFields" type="hidden" value="false">
<input id="Model_SomeFields" name="Model_SomeFields" type="checkbox" value="true">

If not, how can I see the source for CheckBox so I can override it?




Aucun commentaire:

Enregistrer un commentaire