Return LCID From HTTPContext
A friend today asked me if it was possible to pass in the HTTPContext as a parameter into a static helper method to return the LCID of the current web request. It’s actually really easy.
- public static int harvestCurrentLCID(HttpContext context)
- return (int) SPControl.GetContextWeb(context).Language;
That’s pretty much it, it should return an integer that corresponds to the language type that correlates to the LCID of your SharePoint instance.