从代码隐藏:
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);
Run Code Online (Sandbox Code Playgroud)
如果需要在页面/用户控件上直接填充值,则可以使用这些技术之一从资源文件中获取值.
| 归档时间: |
|
| 查看次数: |
13114 次 |
| 最近记录: |