How to read localized resource labels in MVC widget

Posted by Community Admin on 04-Aug-2018 09:21

How to read localized resource labels in MVC widget

All Replies

Posted by Community Admin on 23-Sep-2016 00:00

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

Posted by Community Admin on 23-Sep-2016 00:00

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

 

 

This thread is closed