suggestion on how to create a Wizard in ASP.NET MVC (no javascript please)?
Does anybody have a suggestion on how to create a Wizard in ASP.NET MVC?
I've google all day long and the only solution I've found is Naddem Affana's Blog. His solution is based on the JQuery. Things were going well until I added a datePicker widget 开发者_如何学Pythonon the page. Since I'm not good in javascript, I'm stuck.
I've tried Steven Sanderson's solution (ASP.NET MVC2), but it was just difficult to adapt it to ASP.NET MVC3. I still wonder why he didn't even include that solution in his latest book.
So, any suggestion on how to create a Wizard in ASP.NET MVC (no javascript please)?
Or maybe the best way is still Wizard- Control in WebForm? which is easy to use.
After resercheang I didn't find anything I could use, as if there's no Wizard application out there. Well, I tried to find out why the solution proposed by Steven Sanderson in his previous book was not working in ASP.NET MVC 3. And I found out that there are only a couple of lines to modify to make it work.
In the Rgistrationcontroller one needs to add a second parameter which could signed or criptedAndSigned. Either way the mode in the controller must match that of the view.
if(serialized != null)
{
regData = (RegistrationData)new MvcSerializer().Deserialize(serialized,
SerializationMode.EncryptedAndSigned);
}
On the view just replace
<%: Html.Serialize("regData", Model)%>
by
@Html.Hidden("regData", new MvcSerializer().Serialize(Model, SerializationMode.EncryptedAndSigned))
I wasted to much trying to find @Html.Serialize(). I'm happy that it works now because the Steven Sanderson's way of doing Wizard is really easy.
精彩评论