title: ASP.NET HttpContext.GetLocalResourceObject() throws InvalidOperationException
body: <p>Let's say we have such site structure:</p>
  
  <p>App_LocalResources<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|- A.aspx.resx<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|- B.aspx.resx<br/>
  A.aspx<br/>
  B.aspx</p>
  
  <p>Now I use HttpContext.GetLocalResourceObject("~/A.aspx", "Key1") <strong>in A.aspx.cs</strong>, and it works fine.
  But if I use HttpContext.GetLocalResourceObject("~/A.aspx", "Key1") <strong>in B.aspx.cs</strong>, it throws an exception:</p>
  
  <p><strong>The resource class for this page was not found.  Please check if the resource file exists and try again.</strong></p>
  
  <p>Exception Details: System.InvalidOperationException: The resource class for this page was not found.  Please check if the resource file exists and try again.</p>
  
  <p>How can I resolve this problem? I want to read the local resources from an external page, and I don't want to read the .resx file myself. Thanks :-)</p>
  
  <p><strong>UPDATE:</strong> In my case, there're some "data.xml" files(they are in different directories, and have elements like <code>&lt;key name='Key1' value='value1' /&gt;</code>), and the contents of them will be rendered as html. </p>
  
  <p>But the key names in the data.xml should be localized before rendering (different data.xml contain different keys).</p>
  
  <p>For example, the data.xml has such an element:</p>
  
  <pre><code>&lt;key name='CategoryId' value='3' /&gt;
  </code></pre>
  
  <p>In the result html page, I want to display "Category Id = 3" for en-US culture, and "类别=3" for zh-CN culture, etc.</p>
  
  <p>So I think I can create some files following the pattern "<code>data.xml.??-??.resx</code>" in the <code>App_LocalResources</code> folder, then use the <code>HttpContext.GetLocalResource()</code> for each data.xml to retrieve the localized key names. That way I <strong>don't need to read the xml myself</strong>. Is it possible?</p>