sitefinity | cms | localization

Sitefinity - Read localized resource labels in MVC widget

Explains how to get localized labels in Sitefinity MVC widgets.

Abhith Rajan
Abhith RajanDecember 07, 2017 · 1 min read · Last Updated:

In your Razor View,

@Html.Resource("ResourceLabel", "ResourceName")

In the above code, replace ResourceLabel with the key and ResourceName with the type, you used to create the label in the Sitefinity CMS. Make sure Telerik.Sitefinity.Frontend.Mvc.Helpers namespace is imported in the view. i.e

@using Telerik.Sitefinity.Frontend.Mvc.Helpers;

Sample usage

<li><a href="/">@Html.Resource("Home", "PageResources")</a></li>

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub


Abhith Rajan

Written byAbhith Rajan
Abhith Rajan is a software engineer by day and a full-stack developer by night. He's coding for almost a decade now. He codes 🧑‍💻, write ✍️, learn 📖 and advocate 👍.
Connect

Is this page helpful?

Related ArticlesView All