Search for:
Sign in
Register
Menu
Articles
Questions & Answers
Download
Documentation
Support
Marketplace
Old Forums
Search:
Search text
ASPX templates
Version 5.x
>
ASPX templates
>
Current culture in a CMS Form Control
View modes:
View mode
Threaded
Flat - newest to oldest
Flat - oldest to newest
Member
efusien
-
11/10/2010 11:32:18 AM
Current culture in a CMS Form Control
Hello,
I create my own CMSFormControls.
In the .ascx file I want to get the current culture.
In exemple "en" or "fr", I guess it depends on the web site culture.
How can I do ?
Kentico Developer
kentico_ivanat
-
11/10/2010 12:46:46 PM
RE:Current culture in a CMS Form Control
Hi.
You can get the current culture using:
//returns for example en-US
String currentCultureCode = CMSContext.CurrentDocument.DocumentCulture;
Alternatively you can use:
CookieHelper.GetValue("CMSPreferredCulture");
Best regards,
Ivana Tomanickova
Member
efusien
-
11/10/2010 1:01:47 PM
RE:Current culture in a CMS Form Control
Perfect !
Member
efusien
-
11/10/2010 1:03:53 PM
RE:Current culture in a CMS Form Control
I just add a Substring to display only the 2 first letters :
<%=CMSContext.CurrentDocument.DocumentCulture.Substring(0,2) %>
In my case the result is like "fr" or "en".
Top