How to resolve "Uncaught TypeError" that cannot read property 'numberFormat' of null " error message in .NET MVC CurrencyTextBox?
Problem
When EJ controls are rendered with Localization, the error, Uncaught TypeError: Cannot read property 'numberFormat' of null, occurs. This error occurs when the Locale property value is set to the controls and when you fail to refer to the corresponding culture file.
Solution
In order to resolve this issue, ASP.NET MVC Currency textbox is used to resolve this issue. For example, when CurrencyTextbox is taken, you have to render Currency textbox in the View page with the culture fr-FR, as shown in the following code example. Also refer to the corresponding culture file in the sample
View
@Html.EJ().CurrencyTextbox("currency").Value("50").Locale("fr-FR")
When Localization is enabled in the controls, then you have to refer to the corresponding culture as shown in the following code example.
Layout
<link href="@Url.Content("~/Content/ej/web/Default-theme/ej.widgets.all.min.css")" rel="stylesheet"/> <script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.easing-1.3.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery.globalize.min.js")"></script> <script src="@Url.Content("~/Scripts/Cultures/globalize.culture.fr-FR.min.js")"></script> <script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")"></script> <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>
Documentation: https://help.syncfusion.com/js/overview
Sample:
Conclusion
I hope you enjoyed learning about how to resolve Uncaught TypeError that cannot read property numberFormat of null error message in .NET MVC CurrencyTextBox
.
You can refer to our .NET MVC feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our .NET MVC example example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trialto check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedbackportal. We are always happy to assist you!