+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / LocalResources and User Controls

LocalResources and User Controls

3 posts, 1 answered
  1. Trevor
    Trevor avatar
    18 posts
    Registered:
    05 Oct 2010
    04 Nov 2010
    Link to this post
    Hey guys,

    I've been searching for tutorials on localizing with sitefinity and I haven't found exactly what I'm looking for. I have localization enabled for my site and my pages have multiple versions (fr/en/es/etc), but I want my user controls to grab values from local resource files and I haven't been able to get this to work...

    Most tutorials out there tell you to go to Tools > Generate Local Resource and you're done, but I don't even have that option (I'm using VS2008 and I'm using the browser app, not the VS web app). I created an App_LocalResources folder in my website folder (%sitefinityDir%\Websites\siteName\App_LocalResources) and I have a page called TestLogin.aspx with a single module on it called MyCustomLogin.ascx (has a .cs behind it too). MyCustomLogin has 2 labels, lblUsername and lblPassword, which I want localized via a resource file.

    I've already tried putting MyCustomLogin.ascx.resx (and its .es / .fr versions as well) into the app_local resource folder, along with meta:resourcekeys in the code and even <% $Resources:resourceName %> into the appropriate positions, but none of these methods work...

    Is %sitefinityDir%\Websites\siteName\App_LocalResources the right directory for that folder? should it be GlobalResources? Is there a way to properly link the files (I just threw them in there with names, assuming Sitefinity recognized them like everything else)?

    Thanks in advance,
    Trevor
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Nov 2010
    Link to this post
    Hi Trevor,

    For your custom control you have to use Local resources - Resources and Localization in ASP.NET. You can see how we do this for Forums public control - Sitefinity/Admin/ControlTemplates/Forums folder

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Trevor
    Trevor avatar
    18 posts
    Registered:
    05 Oct 2010
    04 Nov 2010
    Link to this post
    That definitely helped solve my problem!

    Thank you very much!
Register for webinar
3 posts, 1 answered