コード例 #1
0
 public ActionResult PostParentViewModel(ParentViewModel vm)
 {
     ViewBag.Action         = "PostParentViewModel";
     ViewBag.ModelType      = vm.GetType().Name;
     ViewBag.BoundModelData = JsonConvert.SerializeObject(vm, Formatting.Indented);
     ViewBag.BoundModel     = vm;
     return(View("ChangingContext"));
 }
コード例 #2
0
 public ActionResult PostParentViewModel(ParentViewModel vm, bool tagHelpers)
 {
     ViewBag.Action         = "PostParentViewModel";
     ViewBag.ModelType      = vm.GetType().Name;
     ViewBag.BoundModelData = JsonSerializer.Serialize(vm, new JsonSerializerOptions {
         WriteIndented = true
     });
     ViewBag.BoundModel = vm;
     return(View(tagHelpers ? "ChangingContextTH" : "ChangingContext"));
 }
コード例 #3
0
 public ActionResult PostParentViewModel(ParentViewModel vm)
 {
     ViewBag.Action = "PostParentViewModel";
     ViewBag.ModelType = vm.GetType().Name;
     ViewBag.BoundModelData = JsonConvert.SerializeObject(vm, Formatting.Indented);
     ViewBag.BoundModel = vm;
     return View("ChangingContext");
 }