I have an MVC multilingual application. I am trying to post value like 1,20 with decimal data type textbox in es-AR culture from a view with MVC form. My validation is working perfect as expected But when I try to post to MVC controller with value as mentioned it doesn't works. If I try to post a value like 1,200 it works perfectly. I am using http://ajax.aspnetcdn.com/ajax/jQuery.Validate/1.6/localization/messages_de.js for validation. Can any body help me to find a solution
UDATED
My MVC view
@model BuyCreditViewModel
@using (Ajax.BeginForm("SomeActionName", "SomeControllerName", null, new AjaxOptions()
{
HttpMethod = "POST",
UpdateTargetId = "divPaymentProvider",
OnBegin = "OnBegin",
OnSuccess = "OnSuccess",
OnFailure = "OnError"
}, new { id = "frmPostAmt"}))
{
<div class="multy_form_holder">
<div class="multy_title">Amount</div>
<div class="multy_inputholder">
@Html.TextBoxFor(model => model.Cost, new { id = "txtAmount", @class = "multy_singleline" })
</div>
<div class="multy_validate_holder">@Html.ValidationMessageFor(model => model.Cost)<span id="lblCost"></span></div>
<div class="clear"></div>
</div>
}
// To validate the text box with decimal data type using methods_de.js
<script type="text/javascript">
$(document).ready(function () {
$("#frmPostAmt").validate();
}
My ViewModel
public class BuyCreditViewModel
{
[Required]
public decimal? Cost { get; set; }
}
My Controller
[HttpPost]
public ActionResult SomeActionName(BuyCreditViewModel accountViewModel)
{
//TO Code
}