从本地.resx文件获取价值 [英] Get Value from local .resx file

查看:140
本文介绍了从本地.resx文件获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能从本地.resx文件值在asp.net?

How can i get value from local .resx file in asp.net?

推荐答案

从code-背后:

CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");

// Gets the value of associated with key "MyKey" from the local resource file for a given culture ("~/MyPage.aspx.en.resx") or from the default one ("~/MyPage.aspx.resx")
object keyValue = HttpContext.GetLocalResourceObject("~/MyPage.aspx", "MyKey", culture);

如果您需要的值可以直接在你的页面/用户控件填充,然后你可以使用的这些技术来从资源文件获取值。

If you need the value to be populated directly on your page/user control then you can use one of these techniques to get the values from the resource files.

这篇关于从本地.resx文件获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆