Monday, August 21, 2017

How to load Resource from C# to javascript

HTML: Controller WEB: public class ResourcesController : Controller { // GET: Admin/Resources [OutputCache(CacheProfile = "CacheLang")] public JavaScriptResult Index(string lang) { var culture = new CultureInfo(lang); // return null; return HtmlHepper.JavascriptResources(Resources.Language.ResourceManager, "Lang", culture); } } Use in web: Lang.System_Error

No comments:
Write comments