I have a html element which binded to a model (using MVC3)
<label id="total-amount">
@Html.Encode(@Model.TotalAmount)
</label>
I am modifying the value using Jquery in the client side
if (!$(this).is(':checked')) {
var lblTotalAmount = $("#total-amount");
var totalAmount = nationalPrice + recurPrice;
lblTotalAmount.text(totalAmount.toFixed(2));
}
It works fine. But when I'm posting the value of the Model.TotalAmount in my controller.. the value I modified through JQuery doesnt reflect...
[HttpPost]
[ActionName("Payment")]
public ActionResult PaymentViaPost(PaymentVM viewModel)
{
//still the same value before JQuery modification
var totalAmount = viewModel.TotalAmount;
Am I missing something here like I need an async call using AJAX or something... and if it does How do I do that?