Ajax Serialize需要获得价值

时间:2011-12-08 20:37:29

标签: asp.net-mvc jquery

我有以下ajax序列化:

    $.ajax({
         type: "POST",
         url: $form.attr('action'),
         data: $form.serialize(),
         error: function (xhr, status, error) {
             ConfirmDialog('The page save failed.');
           },
      success: function (response) {
     // need to retrieve an output value from the controller here 

     }
}); 

当它发布帖子时,我正在做一个ActionResult方法。如何从ActionResult传递一个值,以便在成功时获取它的值(在成功的地方:function(response)。

1 个答案:

答案 0 :(得分:0)

输出在响应中

 success: function(response) {
    alert( response ); 
 }