kentico_michal
-
1/14/2011 6:25:05 AM
RE:detect language using javascript
Hi,
You can put some literal control into the page (if you are using portal engine, you can put it into some user control that you can put on the page using UserControl web part) and into Text property of this literal you can put (e.g. in Page_Load method) HTML tag input of type hidden and into its value attribute insert the culture code. Please find sample code bellow:
ltlInput = "<input type=\"hidden\" id=\"cultureCode\" name=\"cultureCode\" value=\"" + CMS.CMSHelper.CMSContext.CurrentDocumentCulture + "\" />";
Then the culture code will be not visible on the page, but it will be present in the HTML source code of the page, so you will be able to access the value using javascript (e.g. using GetElementByID function).
Best regards, Michal Legen
|