开发者

How can I get local resources in a controller in ASP.NET MVC?

开发者 https://www.devze.com 2022-12-28 13:24 出处:网络
I know I can use the namespace Resources to get resources within App_GlobalResources but how do I get local resources within a controller?

I know I can use the namespace Resources to get resources within App_GlobalResources but how do I get local resources within a controller?

Example, a folder in Views folder called Misc, with a page.aspx, and a App_LocalResources folder with the file page.aspx开发者_运维问答.ascx.


One way to do is: HttpContext.GetLocalResourceObject("~/Views/FOLDER/VIEW.cshtml", "KEY").ToString();

0

精彩评论

暂无评论...
验证码 换一张
取 消