2014-01-06 12 views
1

如何使用ajax post(ASP NET MVC 4)獲取字段[NotMapped]屬性中的值?如何使用ajax post(ASP NET MVC 4)獲取字段[NotMapped]中的值

$('#btnSalvarParcela').click(function() { 

    $.ajax({ 
     url: '@Url.Action("CadastroLancamentoParcelar", "LancamentoReceitaDespesa")', 
     type: 'POST', 
     data: $("#LancamentoForm").serialize(), 
     cache: false, 
     context: this, 
     success: function (result) { 
      $("#partialLancamentoReceitaDespesa").html(result); 
      mudarComboTipoLancamento(); 
     } 
    }); 
}); 

( 「#LancamentoForm」)序列化() - [notmapped]會控制器作爲空領域,是對檢索這些值?

+0

您可能可以使用Request.QueryString屬性關閉上下文來獲取所有值。 –

+0

什麼是(「#LancamentoForm」)?是一個文本框的價值?隱藏領域?因爲它看起來像你沒有正確傳遞 – CSharper

回答

0

Request.Form [「YourInput」];將會得到它,如果它被張貼。我猜想這很可能不是表格的一部分,或者有錯字或其他內容。 (但是,我不熟悉[NotMapped])

相關問題