views:

19

answers:

0

I’ve developed a Web User Control with ASP.NET Web Foms that uses client side binding and allows to the user to enter a series of items. During a post, the JavaScript code of my control serializes the items in JSON and put them in a hidden field so the server code of the control can take this JSON string, deserialize it and expose the entered items through a property . How can I obtain a similar functionality and reusability with MVC since during a post my control won’t be there to take this JSON string and interpret it correctly? In the end, the hidden field “trick” and the specifics of what data is serialized (and in what way) is just part of the internals of my control that shouldn’t have to care to “anyone” outside it (after all, that’s why the component abstraction exists). (Sorry about my English)