Localization and UserControl/Web designer
In the example of the localization, there are link buttons to change the language put on child screen aspx (UserRegistration.aspx).
Now, I have my master page composed of small UserControls. There are placeholders for TopMenuUserControl, LeftSideUserControl, BottomuserControl, and the placeHolder for the main content.
So in the main content there would come for example DocumentsTree.aspx. If I put link buttons to change the language on that child aspx DocumentsTree.aspx, everything is ok, because I can set:
this.UserCulture = new CultureInfo((string) e.CommandArgument);
UserCulture is inherited from Spring-Page.
Now my problem: My Web designer wants me to put the links in a part of the page where menus are. So I have to put my links into TopMenuUserControl which inherits Spring-UserControl. But then I do not have this.UserCulture to set. how do I resolve that? Is it possible to change the language localization only in child pages?
You should still be able to do it.
Spring UserControl also exposes UserCulture property and simply delegates it to the page that contains it, so everything should work fine.
The current version of Spring UserControl in cvs does not support setter for UserCulture (only read). And it also does not expose CultureResolver.
Is there a way to get that correct version with those features?
Is there any progress in having Spring.UserControl a setter for UserCulture and to expose CultureResolver? I thing this is a very important issue? Thank you for the kind answer.
Sorry it took so long... I saw your message and was gonna fix the problem, but then I got sidetracked and completely forgot about it.
I just checked in modified UserControl class that implements UserCulture setter as well, so you can get it from CVS. I didn't expose CultureResolver though, as it is only used internally by the UserCulture property within the Page class. If you have a good reason to expose it let me know and I'll do it, although I really can't see why it would be useful.
BTW, UserControl's Page property is overriden to return Spring.Web.UI.Page instance instead of System.Web.UI.Page, so you can access all Spring Page properties through it as well.
I used UserControl's Page property:
public void SetLanguage(object sender, CommandEventArgs e)
Page.UserCulture = new CultureInfo((string) e.CommandArgument);
It is working correctly!
But UserCulture is still as readonly in cvs! Is there some delay between checksin or something. Or do I have to use something else to get the latest version? I used:
cvs -dserver:firstname.lastname@example.org:/cvsroot/springnet login
cvs -z3 -dserver:email@example.com:/cvsroot/springnet co -P Spring.Net
Yeah, there might be some delay between development and anonymous CVS. Not sure how long it takes for them to synch up...