public ActionResult BindToChildViewModel(ModelBinderViewModel viewModel) { var json = JsonConvert.SerializeObject(viewModel, Formatting.Indented); Debugger.Break(); return(this.Content(json)); }
// White list public ActionResult BindToViewModelInclude([Bind(Include = nameof(ModelBinderViewModel.Name))] ModelBinderViewModel viewModel) { var data = this.HttpContext.Request.Form; var json = JsonConvert.SerializeObject(viewModel, Formatting.Indented); Debugger.Break(); return(this.Content(json)); }
public ActionResult BindToChild(ModelBinderViewModel viewModel) { if (this.ModelState.IsValid) { var json = JsonConvert.SerializeObject(viewModel, Formatting.Indented); return(this.Content(json)); } return(this.View(viewModel)); }
public ActionResult JsonModelBinder([ModelBinder(typeof(JsonModelBinder))] ModelBinderViewModel viewModel) { if (this.ModelState.IsValid) { Debugger.Break(); var json = JsonConvert.SerializeObject(viewModel, Formatting.Indented); return(this.Content(json)); } return(this.View(this.HttpContext.Request.Form[nameof(JsonViewModel.Json)])); }
public ActionResult BasicMappingForm(ModelBinderViewModel model) { return(this.Json(model)); }