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

Forums / Developing with Sitefinity / How to read localized resource labels in MVC widget

How to read localized resource labels in MVC widget

2 posts, 0 answered
  1. Ajai
    Ajai avatar
    15 posts
    Registered:
    02 Mar 2015
    23 Sep
    Link to this post

    Hi All,

    I am working on sitefinity 9.1 and focused on MVC based development with multilingual support. I have created a simple mvc widget and i want to display localized labels in that.

    I have found the below code piece that can be used in web-form widgets and master pages 

    <asp:Label runat="server" ID="lbl1" Text='<%$ Resources:NewsResources, Content %>'></asp:Label>

    and seems working fine with in my multilingual site.How can i achieve the same in mvc widget?

     

    Thanks

    Ajai

  2. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    23 Sep
    Link to this post

    Hi Ajai,

    In view you can use it like that:

    <h1>@Html.Resource("ResorceLabel", "ResorceName")</h1>

    And you need @using Telerik.Sitefinity.Frontend.Mvc.Helpers for that

     

     

2 posts, 0 answered