ASP.NET MVC - Model binding a set of dynamically generated checkboxes - how to

前端 未结 3 1740
旧巷少年郎
旧巷少年郎 2021-02-02 01:42

I\'m trying to model bind a set of dynamically generated checkboxes so as to process them in the controller action but can\'t get the model binding to occur. This is the scenari

3条回答
  •  醉话见心
    2021-02-02 02:25

    hidden elements are the modus operandi of asp.net. in the webforms version it was the ViewState, which was a massive hidden field, in the MVC its lighter weight more straightforward hidden fields per control. I'm not sure what's wrong or disturbing about that. Somehow you have to keep state, you can either do it client side or server side. I suggest client side for non-sensitive information that way it will still be there if the server is restarted between postbacks etc.

提交回复
热议问题