Well,
I have a PartialView who generate a VIEW with a complex Model. I have a button that I want to regenerate COMPLETELY my PartialView
@if (!Model.editFlag) { <button id="EditButton" class='btn btn-small'>Edit</button> } else { <button class='btn btn-small'>Update</button> }
This is my Ajax CALL
$.ajax(
{
type: "POST",
url: "@Url.Action("DeviceDetails_Edit","DeviceLayout")" ,
data:
{
DeviceID: '@Model.DeviceID',
DeviceName: '@Model.DeviceName',
DeviceDescription: '@Model.DeviceDescription',
editFlag: '@Model.editFlag',
},
cache:false,
success: function(html)
{
alert('success');
},
error: function(e)
{
alert("errorn");
}
});
});
and from controller, I have an ActionResult , who returns a partial view with MY NEW SPECIFIC MODEL return PartialView("_DeviceDetails", model);
Into My view , exists more more PartialView`s
How can I resolve this problem ?