Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get CultureInfo from client machine?

so this is question for 1mln$.

First of all, I'm developing web application in Visual WebGui. This is basically Winforms, but than application is converted to HTML5 and vualá.. web application. Anyway, I have a problem with DateTime formats. By default it is CultureInfo from server machine.

I can override this in web.config like that:

<globalization requestEncoding="utf-8" responseEncoding="utf-8"  culture="de-DE" uiCulture="de-DE"/>

Every dateformat will be german on every client machine. What I want is to make a web application, which will display Datetime format like on client machine in control panel.

Is it possible? I just can't find the solution.

Thanks for help,

like image 586
Marshall Avatar asked Oct 07 '22 13:10

Marshall


1 Answers

Try this:

Thread.CurrentThread.CurrentCulture = new CultureInfo(Request.UserLanguages[1]);

Check this link for example Multilingual Application

like image 104
Vinod Avatar answered Oct 12 '22 11:10

Vinod