Конечно, предположим, что у вас строго типизированное представление:
@model Obj
<script type="text/javascript">
// Serialize the model into a javascript variable
var model = @Html.Raw(Json.Encode(Model));
// post the javascript variable back to the controller
$.ajax({
url: '/home/someAction',
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: JSON.serialize(model),
success: function(result) {
// TODO: do something with the results
}
});
</script>
и в действии контроллера:
public ActionResult SomeAction(Obj obj)
{
...
}
Просто замечание об этом объекте, сделайте его общедоступнымсвойства вместо некоторых полей:
public class Obj
{
public string A { get; set; }
public int B { get; set; }
public double C { get; set; }
}