使用WebForms应用程序中的类库中的资源 [英] Use resources in Class Library from WebForms app

查看:77
本文介绍了使用WebForms应用程序中的类库中的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

在我的应用程序中有一个类库项目和一个网站。

我在类库中创建一个资源文件,它的修饰符是公共的。 />


我需要在网站层使用这个资源,但我有错误。



hello
In my application there is one class library project and one website.
I create a resource file in class library and modifier of it is public.

I need to use this resource in website layer but i giv error.

<asp:Label ID="Label2" runat="server" Text="<%$ Resources:resourceName, ErrorEmptyName %>"></asp:Label>





错误:



error:

The resource object with key 'ErrorEmptyName ' was not found.	





但在代码页中我访问此密钥:

Label1.Text = resourceName.ErrorEmptyName;

并且没有错误。



我的资源文件对我来说是 resx extention 。



有什么问题?怎么做?



提前谢谢。



but in code page i access this key:
Label1.Text = resourceName.ErrorEmptyName;
and no error.

my resource file for me is a file with resx extention.

What is wrong?how do it?

Thank you in advance.

推荐答案

资源:resourceName,ErrorEmptyName %> > < / asp:Label >
Resources:resourceName, ErrorEmptyName %>"></asp:Label>





错误:



error:

The resource object with key 'ErrorEmptyName ' was not found.	





但在代码页中我可以访问此密钥:

Label1.Text = resourceName.ErrorEmptyName;

没有错误。



我的资源文件对我来说是 resx extention 的文件。



有什么问题?怎么做?



提前谢谢。



but in code page i access this key:
Label1.Text = resourceName.ErrorEmptyName;
and no error.

my resource file for me is a file with resx extention.

What is wrong?how do it?

Thank you in advance.


这篇关于使用WebForms应用程序中的类库中的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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