开发者

MVC Localization ViewData["message"]

开发者 https://www.devze.com 2022-12-24 20:37 出处:网络
If i wanted to get message for ViewData from resource file, depending on the culture i set, how can i do this?

If i wanted to get message for ViewData from resource file, depending on the culture i set, how can i do this?

ViewData["messag开发者_如何学Goe"] = "ErrorMessage";

am i making sense


ViewData["message"] = Resources.ErrorMessage;

where Resources is a resx file that you've added to your project. Visual Studio automatically generates strongly typed classes for each resource you add.

0

精彩评论

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

关注公众号