1

How get values in fields [NotMapped] attributes using ajax post (ASP NET MVC 4)?

 $('#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").serialize() - the field [notmapped] is going to controller as null, is to retrieve these values​​?

2
  • you can probably get all the values using the Request.QueryString property off the context. Commented Jan 6, 2014 at 16:14
  • what is ("#LancamentoForm")? is the value of a textbox? hidden field? because it looks like you are not passing this correctly Commented Jan 6, 2014 at 16:23

1 Answer 1

0

Request.Form["YourInput"]; will get it if it was posted. I'd guess it's most likely not part of the form, or there's a typo or something. (However, I am not familiar with [NotMapped])

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.