How to suppress initial validation error in ASP.NET MVC3 -
asp.net mvc3 view displays validation error if request invoked. how show validation error if post request used in mvc2 ?
view:
<%= html.validationsummary(false, "error") %>
controller:
namespace store.controllers { public class checkoutcontroller : myapp.controllers.controllerbase { [httpget] public actionresult address() { return view(new addressviewmodel()); } [httppost, validateantiforgerytoken] public actionresult address(addressviewmodel model, string name) { if (!modelstate.isvalid) return view(model); return redirecttoaction("payment"); } } }
Comments
Post a Comment