sebastijanp
09-26-2005, 12:13 PM
Hi!
I read the article:
http://msdn.microsoft.com/asp.net/community/authors/mlb/default.aspx?pull=/library/en-us/dnaspp/html/aspnet-globalarchi.asp
I have teh following structure of web app. myWebApp:
Inetpub
wwwroot [Folder]
myWebApp [Folder]
Cbp [Folder]
CbpDocumentsTree.aspx
CbpDocumentsTree.en-US.resx
CbpDocumentsTree.sr-SP-Latn.resx
Img [Folder]
Default.aspx
and created by the above article two resource embeded files:
CbpDocumentsTree.en-US.resx
CbpDocumentsTree.sr-SP-Latn.resx
In web.config I set:
<object id="basePage" abstract="true">
<property name="Master">
<ref object="masterPage"/>
</property>
<property name="LocaleResolver">
<object type="Spring.Web.Localization.Resolvers.CookieLocaleReso lver, Spring.Web"/>
</property>
</object>
<object type="~/Cbp/CbpDocumentsTree.aspx" parent="basePage">
</object>
Then I set on a button click on CbpDocumentsTree.aspx page:
protected override void OnInit(EventArgs e)
{
InitializeComponent();
this.english.Command += new CommandEventHandler(this.SetLanguage);
this.serbian.Command += new CommandEventHandler(this.SetLanguage);
base.OnInit(e);
}
private void SetLanguage(object sender, CommandEventArgs e)
{
this.UserLocale = new CultureInfo((string) e.CommandArgument);
}
But then when I click on a button:
<asp:ImageButton id="english" Runat="server" CommandArgument="en-US" ImageUrl=""></asp:ImageButton>
<asp:ImageButton id="slovenian" Runat="server" CommandArgument="sl"></asp:ImageButton>
The SetLanguage gets executed but nothing happens. It is because .net can not find resources:
CbpDocumentsTree.en-US.resx
CbpDocumentsTree.sr-SP-Latn.resx
DO I HAVE TO SET ALSO SOMETHING ELSE?
Thank you for your help. This Spring Web is Best!!!
Lp
S
I read the article:
http://msdn.microsoft.com/asp.net/community/authors/mlb/default.aspx?pull=/library/en-us/dnaspp/html/aspnet-globalarchi.asp
I have teh following structure of web app. myWebApp:
Inetpub
wwwroot [Folder]
myWebApp [Folder]
Cbp [Folder]
CbpDocumentsTree.aspx
CbpDocumentsTree.en-US.resx
CbpDocumentsTree.sr-SP-Latn.resx
Img [Folder]
Default.aspx
and created by the above article two resource embeded files:
CbpDocumentsTree.en-US.resx
CbpDocumentsTree.sr-SP-Latn.resx
In web.config I set:
<object id="basePage" abstract="true">
<property name="Master">
<ref object="masterPage"/>
</property>
<property name="LocaleResolver">
<object type="Spring.Web.Localization.Resolvers.CookieLocaleReso lver, Spring.Web"/>
</property>
</object>
<object type="~/Cbp/CbpDocumentsTree.aspx" parent="basePage">
</object>
Then I set on a button click on CbpDocumentsTree.aspx page:
protected override void OnInit(EventArgs e)
{
InitializeComponent();
this.english.Command += new CommandEventHandler(this.SetLanguage);
this.serbian.Command += new CommandEventHandler(this.SetLanguage);
base.OnInit(e);
}
private void SetLanguage(object sender, CommandEventArgs e)
{
this.UserLocale = new CultureInfo((string) e.CommandArgument);
}
But then when I click on a button:
<asp:ImageButton id="english" Runat="server" CommandArgument="en-US" ImageUrl=""></asp:ImageButton>
<asp:ImageButton id="slovenian" Runat="server" CommandArgument="sl"></asp:ImageButton>
The SetLanguage gets executed but nothing happens. It is because .net can not find resources:
CbpDocumentsTree.en-US.resx
CbpDocumentsTree.sr-SP-Latn.resx
DO I HAVE TO SET ALSO SOMETHING ELSE?
Thank you for your help. This Spring Web is Best!!!
Lp
S