开发者

Multi-lingual static content in ASP.NET

开发者 https://www.devze.com 2022-12-24 03:52 出处:网络
开发者_开发问答Is there a simple way of making the static content of an .aspx page multi-lingual? Resource files are nice for controls but it\'s quite hard and annoying to write big chunks of html in

开发者_开发问答Is there a simple way of making the static content of an .aspx page multi-lingual? Resource files are nice for controls but it's quite hard and annoying to write big chunks of html in them. Any easier ways?


Make properties in resources files and use them, .NET automatically finds the correct resource file, also just make sure so that the property name is same in all the resource files, so it will replace the property value in .aspx page with the value in the resource file.

Don't code html markup in resource file, have the html markup in the .aspx page itself, just get the essential values from resource files.


Just to reiterate what Mahesh said: do NOT put markup in the resource files, just put the static content into them.

If you need to serve different views based on culture, consider doing something else. For example, if you're using MVC you could write a view engine that return the correct markup for each culture.


@ciscoheat what you say is correct, LOCALIZE control is the right thing to use for big chunk of data.

0

精彩评论

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