我有一个MVC多语言应用程序。我试图从MVC形式的视图发布es-AR文化中的带有十进制数据类型文本框的1,20值。我的验证工作正如预期的那样完美但是当我尝试按照提到的值发布到MVC控制器时它不起作用。如果我尝试发布1,200这样的值,那就完美了。我正在使用http://ajax.aspnetcdn.com/ajax/jQuery.Validate/1.6/localization/messages_de.js进行验证。 任何人都可以帮我找到解决方案
UDATED
我的MVC视图
@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();
}
我的ViewModel
public class BuyCreditViewModel
{
[Required]
public decimal? Cost { get; set; }
}
我的控制器
[HttpPost]
public ActionResult SomeActionName(BuyCreditViewModel accountViewModel)
{
//TO Code
}