Note that there are some explanatory texts on larger screens.

plurals
  1. POOverriding default ResourceProvider
    text
    copied!<p>I need to retrieve local resources using an application context defined in <code>appSettings</code>:</p> <pre><code>&lt;add key="ApplicationContext" value="CTX1"/&gt; </code></pre> <p>which could also be deployed with another value:</p> <pre><code>&lt;add key="ApplicationContext" value="CTX2"/&gt; </code></pre> <p>and define local resources like this:</p> <pre><code>&lt;root&gt; &lt;data name="CTX1_BodyTitle1" xml:space="preserve"&gt; &lt;value&gt;Welcome to context 1&lt;/value&gt; &lt;/data&gt; &lt;data name="CTX2_BodyTitle1" xml:space="preserve"&gt; &lt;value&gt;Welcome to context 2&lt;/value&gt; &lt;/data&gt; &lt;root&gt; </code></pre> <p>then use implicit resource name in aspx page:</p> <pre><code>&lt;h2&gt;&lt;asp:Literal runat="server" meta:ressourcekey="BodyTitle1"&gt;&lt;/asp:Literal&gt;&lt;/h2&gt; </code></pre> <p>I tried to implement a custom ResourceProvider as told on <a href="http://msdn.microsoft.com/en-us/library/aa905797.aspx" rel="nofollow">msdn</a> but did not manage to do something effective nor simple.</p> <p>Any idea how to privide this without reimplementing the whole <a href="http://msdn.microsoft.com/en-us/library/system.web.compilation.resourceproviderfactory.aspx" rel="nofollow"><code>ResourceProviderFactory</code></a>?</p> <p><strong>EDIT:</strong></p> <p>I want to implicitly retrieve <strong>local</strong> resources from <code>Page1.en.resx</code>, <code>Page1.fr.resx</code> according to ApplicationContext, then use an unique identifier in <code>Page1.aspx</code> to link to defined resources.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload