开发者

how to save text in app_resource. asp net mvc c# metatags

开发者 https://www.devze.com 2023-01-14 02:16 出处:网络
I have all my text inside view coding.I preffer to save it in app_resources, because i would to add other languages in future, and its look quite cleaner.

I have all my text inside view coding. I preffer to save it in app_resources, because i would to add other languages in future, and its look quite cleaner.

I just know that I need to use metatags in my view for te开发者_C百科xt to connect it with file app_resource. How to it correctly, could you show me some examples how it looks like in view??

Thanks a lot and take care, Ragims


You only need to create App_LocalResources folder in the same folder where you hold your views. Then give a name to zzz.resx. And then you can call resources in your view via zzz.

Example: *You have folder Contact in your View Folder. Your add App_LocalResources to Contact folder. Then you give a name Contact.resx to your .resx file.

Finally in the view you can use <%= ContactResources.Contact.Index_ContactWithUs %> where Contact.Index_ContactWithUs - name of concrete resource.

Don't forget that in resources settings you can modify access type (Internal or Public).

0

精彩评论

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