We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

unable to get value in Postback with NumberTextBoxfor and Locale

Thread ID:

Created:

Updated:

Platform:

Replies:

118351 Feb 28,2015 03:30 PM Mar 2,2015 04:57 AM ASP.NET MVC 1
loading
Tags: NumericTextbox
Adrian
Asked On February 28, 2015 03:30 PM

Hi

I'm started working with syncfusion and thinks is amazing. But recently with version v.12.4.0.24I got an strange issue with NumericTextBoxFor.
When I set to use Locale ("es-AR") or Locale ("es-ES"), you can enter a value, and then click on submit button, the value is 0.

For instance.
<div class="row">
                    <div class="col-md-3">
                        @Html.LabelFor(model => model.ExchangeRate, htmlAttributes: new { @class = "control-label" })
                        @Html.EJ().NumericTextBoxFor(model => model.ExchangeRate).Locale("es-AR").ShowSpinButton(false).DecimalPlaces(2)
                        @Html.ValidationMessageFor(model => model.ExchangeRate)
                    </div>
</div>

But when I not using the locale parameter, I can get the value.

<div class="row">
                    <div class="col-md-3">
                        @Html.LabelFor(model => model.ExchangeRate, htmlAttributes: new { @class = "control-label" })
                        @Html.EJ().NumericTextBoxFor(model => model.ExchangeRate).ShowSpinButton(false).DecimalPlaces(2)
                        @Html.ValidationMessageFor(model => model.ExchangeRate)
                    </div>
</div>

This is are the script I´m using in _layout.
 <script src="@Url.Content("~/Scripts/jquery.globalize.min.js")"></script>
<script src="@Url.Content("~/Scripts/cultures/globalize.culture.es-AR.js")"></script>



Regards
Adrian



Kaliswaran Shanmuga Sundaram [Syncfusion]
Replied On March 2, 2015 04:57 AM

Hi Adrian,

Thanks for using Syncfusion product.

Query: “In NumericTextboxFor When I set to use Locale ("es-AR") or Locale ("es-ES"), you can enter a value, and then click on submit button, the value is 0. But when I not using the locale parameter, I can get the value.

We would like to let you know that, in “For” controls while unobtrusive is in enabled state we should give the properties in the view model as shown in the following code snippet.

[Controller]

public ActionResult Index()

        {

            Incident inc =new Incident();

            EditorProperties editor = new EditorProperties();

            editor.ShowSpinButton = false;

            editor.DecimalPlaces = 2;

            editor.Locale = "es-AR";

            ViewData["editmodel"] = editor;

            return View(inc);

        }

We can access the For controls properties by defining it in the view model. If we set unobtrusive is false, then we can access all the properties directly in the builder itself. Please refer the following code snippet to know how to use For control properties when the unobtrusive is set to false.

[cshtml]

@Html.EJ().NumericTextBoxFor(model => model.ExchangeRate).ShowSpinButton(false).DecimalPlaces(2).Locale("es-AR")

 

For your convenience we have prepared a simple sample based on your requirement and the same can be downloaded from the following location.

Sample Location: Sample

Please let us know if you have further concern.

Regards,

Kaliswaran S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;