c# - Return view with ViewModel after ajax call -


i call action ajax function, viewmodel in , try open new view other viewmodel redirecttoaction , return view aren't working. other answers saw got opening other view without sending viewmodel it

ajax call

$("#delete").click(function () {                 var model = $("#forma").serialize();                  console.log("delete", model);                  $.ajax({                     url: '@url.action("deletedevices", "package")',                     contenttype: 'application/json; charset=utf-8',                     datatype: "json",                     data: model,                     success: function (result) {                     }                 });                  return false;             }); 

and contorller nothing

 public actionresult deletedevices(packagedevicesviewmodel viewmodel)         { //model processing here         return view(newmodel); } 

change

data: model, 

to data: json.parse(json.stringify($("form").serializearray()))


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -