次のように、App_Themes のテーマのフォルダー内の App_LocalResources フォルダーにリソース ファイルを配置しました: \App_Themes\Theme1\App_LocalResources\Resources1.aspx.resx
Web フォームの名前が Resources1.aspx で Theme="Theme1" であると仮定すると、プロジェクトの Web フォームからこのファイルのリソースにアクセスするにはどうすればよいですか?
\ App_GlobalResources\Generic.resxにあるglobalresourcesに;でアクセスできます。
<%= Resources.Generic.Cancel %>
ローカルリソースはApp_LocalResourcesフォルダーにありますが、必ずしもルートフォルダーに配置する必要はありません。ローカルリソースの場合は次のようになります。
<%$ Resources:Cancel%>
また
string labelCancel = GetLocalResourceObject("Cancel").ToString();
テーマフォルダにリソースファイルを配置する限り、テーマとリソースを分離し、グローバルリソースを利用して、サイトマスター/ベースページなどのさまざまなリソースをプログラムで切り替えます。
You can use the "Resources" expression to extract values from the resource file, for instance:
<h1><%$ Resources: H1 %></h1>
Alternatively, and especially if you're in code-behind, use GetLocalResourceObject:
h1.InnerText = GetLocalResourceObject ( "H1" ).ToString ( );
EDIT: Sometimes i answer too fast; i don't think themes are localizable in that sense, however there are some workarounds. You could have theme specific items in the resource file and access them depending on current theme.