我有一些aspx页面包含在外部程序集中,这些页面是通过一个客户端PathProvider加载的,除了页面的本地资源外,所有工作都正常。Web应用程序App_LocalResources不工作
因此,例如,我有一个项目Paul.Pages,在Paul.Pages内有多个aspx页面,这些都是嵌入式资源并且都加载了视图PaulPathProvider。
我有页面welcome.aspx有一个单标签welcomeLable(我已经设置Text属性为“Hello World”)在Paul.Pages,我已经生成本地资源为这个页面,现在在Paul.Pages I在.resx文件中也有一个带有welcome.aspx.resx的App_LocalResources文件夹,我有welcomeLabelResource1.Text =“Hello Paul”。
当页面加载时我希望看到“Hello Paul”,但实际上它显示“Hello World”意味着资源字符串没有被加载,我尝试将welcome.aspx.resx设置为Embdedded Resource,但它使没有区别。
任何帮助非常感谢,这是让我疯狂。
Addiontal信息
所以welcome.aspx被包含在组装OliveERP.Common并welcome.aspx命名,这已建立行动=嵌入的资源,因为它是使用自定义路径提供加载。该OliveERP.Common具有包含welcome.aspx.resx的HTML页面本身的App_LocalResources文件夹是
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="welcome.aspx.cs" Inherits="OliveERP.Common.welcome" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label runat="server" ID="welcomeLabel" Text="Hello World" meta:resourcekey="welcomeLabelResource1" />
</div>
</form>
</body>
</html>
但页面仍然显示的Hello World没有你好保罗
你是否为你的标签添加了meta:resourcekey属性? http://msdn.microsoft.com/en-us/library/ms227427(v=vs.100).aspx它总是很难确定一个问题,而不看到导致它的代码 – fuchs777 2014-09-02 11:15:58