Can I post an MVC model using AJAX, like:
$.ajax ({
//what elements are important?
data: '@Model.Product',
success: function(data){
$("#divProducts").html(data);
}
}
I want to avoid changing the model into JSON or JavaScript objects because I would still have to load them from the fields on the page. It would be easier if I use the standard @Html.TextboxFor stuff to fill the model fields and then post the whole model with AJAX.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…