如何以编程方式更改资源文件的值 [英] How to change resource file value programtically

查看:74
本文介绍了如何以编程方式更改资源文件的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从任何主体后面的代码中更改资源文件中的页面标题,不知道如何从资源文件中更改页面标题?

i want to change the page title from resource file from code behind any body have any idea how to change it from resource file???

推荐答案

资源文件在键值对概念上工作.您将已经具有资源文件中的所有值,并且当您想要使用资源键分配变量时,可以按以下方式对其进行分配.

ViewData ["error"] ="resourcefilekey";

在视图中,我们可以直接使用错误值进行显示.

问候,
Lakshmikanth.M
Resource file works on key value pair concept. You will have all the values in resource file already and when you want to assign a variable with the resource key, you can assign it as below.

ViewData["error"]="resourcefilekey";

In the view, we can directly use error value for display.

Regards,
Lakshmikanth.M


这篇关于如何以编程方式更改资源文件的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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