C#ASP.NET中的资源文件 [英] Resource files in C# ASP.NET

查看:47
本文介绍了C#ASP.NET中的资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨......

是否可以使用C#ASP.NET中的资源文件动态更改网页上控件的标题?
如果是,请帮助..

hi....

Is it possible to change the captions of controls on web page dynamically using resource files in C# ASP.NET??
if yes,please help..

推荐答案

是的,可能的.

看一下如何在运行时从资源中获取字符串:
ASP.NET本地化(快速参考) [
Yes, possible.

Look here on how to get a string from resource at runtime:
ASP.NET Localization (Quick Reference)[^]




在资源文件中,您可以设置标题,并且可以在整个Web应用程序中使用该标题.将名称设置为资源中的id,将值设置为标题.您可以提供评论(如果适用).示例:

Hi,

In resource file you can set the caption and that caption can be used from entire web applications. Set the name as id in resources and value as caption. You can provide a comment if applicable. Example:

<asp:label id="Label1" runat="server" text="<%


资源:常见, lblActiveWorklist%>" / >
Resources:Common, lblActiveWorklist %>"/>



在这里,
资源-是访问资源文件的关键字.
通用-是资源文件的名称
lblActiveWorklist-是要访问其标题的资源的ID.

一切顺利.



Here,
Resources - Is the keyword to access the resource file.
Common - Is the name of resource file
lblActiveWorklist - Is the id of the resources of which caption you want to access.

All the best.


这篇关于C#ASP.NET中的资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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