c# - How to serialize an object in MVC 5 Razor view -
i have tried follow this post in order create 3 page form wizard passes data each page.
he uses html helper serialize
, serialize object in view.
@html.serialize("wizard", model)
however html helper isn't available in mvc 5 seems.
i found related post here suggests using following serialize object.
@html.hidden("othercomplexdata", new microsoft.web.mvc.mvcserializer().serialize(complexobject))
but following error
there no argument given corresponds required formal parameter 'mode' of 'mvcserializer.serialize(object, serializationmode)'
it seems want serializationmode, documented 1 doesn't. https://msdn.microsoft.com/en-us/library/microsoft.web.mvc.mvcserializer.serialize(v=vs.118).aspx
what direction can go in now?
thanks.
here's serialization option need:
options signed
or encryptedandsigned
.
you can try , see if work.
there's multiple ways encode data work you. put values in hidden input using json.encode
view, , json.decode
on server side.
Comments
Post a Comment