Get Culture and UICulture from jQuery

I am learning if you can get the Culture and UICulture client from Javascript.

thank

+3
source share
1 answer

There is no way to do this directly using Jquery, however, if you use the .NET framework, you can set Culture and UICulture to public properties and read them from JQuery.

in your CS file:

public string GetCurrentCulture
        {
            get
            {
                return System.Threading.Thread.CurrentThread.CurrentCulture.DisplayName;
            }
        }

And from HTML:

var CurrentCulture = '';
$(document).ready(function () {
    CurrentCulture = '<%= this.GetCurrentCulture %>';
});
0
source

All Articles