Question

I have created an application page which contains many textboxes some of them must accept only decimals (amount). Administrators can change the language and regional settings and some counries has comma as decimal sign and others (english) has dot as decimal signs. How do I can make a proper valdiation for those textboxes based on regional or language settings?

Was it helpful?

Solution

1) For showing the language switch with localized content the one approach you can choose is content translation using Resource Files.

Reference Link : Link

2) The other approach you can go with using the below code block :

        int intLCID = System.Threading.Thread.CurrentThread.CurrentUICulture.LCID;
        if (intLCID == 1025)
        {
            localText.Text = "فريدة عدد";
        }
        else 
        {
           localText.Text = "English";
        }

Note: intLCID=1025 denotes Arabic Language code and en-US denotes intLCID=1033 for else loop.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top