App_LocalResources not working with folders.
-
hey, cant find how to solve this thing, i have a test project with the following directory structure: /root/pages/default.aspx /root/App_LocalResources/default.aspx.resx /root/App_LocalResources/default.aspx.fr.resx using the following simple code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestLocale._Default" UICulture="auto:en-US" Culture="auto:en-US"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Label" meta:resourceKey="Label1"></asp:Label> </div> </form> </body> </html>
at the resx file i have simple mapping for Label1.Text , The problem: for ssome reason ASP.NET can't find local resources when my default page is not at the root folder in the project, when i place the default.aspx in the root project the localization works, when i place the default.aspx inside a folder it doesnt work i have been searching everywhere and couldnt find how to make it work when using folders. any kind of help would help! thank you.Net
-
hey, cant find how to solve this thing, i have a test project with the following directory structure: /root/pages/default.aspx /root/App_LocalResources/default.aspx.resx /root/App_LocalResources/default.aspx.fr.resx using the following simple code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestLocale._Default" UICulture="auto:en-US" Culture="auto:en-US"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Label" meta:resourceKey="Label1"></asp:Label> </div> </form> </body> </html>
at the resx file i have simple mapping for Label1.Text , The problem: for ssome reason ASP.NET can't find local resources when my default page is not at the root folder in the project, when i place the default.aspx in the root project the localization works, when i place the default.aspx inside a folder it doesnt work i have been searching everywhere and couldnt find how to make it work when using folders. any kind of help would help! thank you.Net
-
The App_LocalResources folder needs to be in same folder as the aspx file. /root/pages/App_LocalResources/Default.aspx.resx /root/pages/Default.aspx Hope this helps Martin