Last post Oct 04, 2006 09:08 AM by Flax
Sep 24, 2006 11:30 AM|Flax|LINK
I'm trying to localize a CreateUserWizard control. I customize the user steps and I managed to localize all the controls like labels and textboxes using meta:resourcekey, but how can I localize the buttons "create user" and "cancel"? I tried using CreateUserButtonText="<%$
Resources:btnCreateUser %>", but as soon i switch in the design view, I get "Error Creating Control - Object reference not set to an instance of an object" and the CreateUserWizard is not shown anymore. How can I solve this problem?
Thanks for help
Sep 26, 2006 07:31 PM|Eilon|LINK
Hmm, I'm not sure what's causing that, but in Page_Load (or wherever) you can call GetGlobal/LocalResourceObject() to get the resource manually.
Sep 29, 2006 02:58 PM|Flax|LINK
Sep 30, 2006 01:00 PM|rjstinyc|LINK
Try reading over the information on the MSDN link provided. The procedure is very intuitive and worked for me.
Richard J. Rothery Jr.
Sep 30, 2006 01:10 PM|rjstinyc|LINK
The above post is if you are using Visual Studio 2005.
Oct 02, 2006 05:32 AM|Flax|LINK
Mmmh isn't that article about how to localize in general? Don't see any call in page_load or a call to GetGlobal/LocalResourceObject() to get the resource manually. I already tried those method for the explicit localization, but not the one with the meta:resourcekey
'cause those buttons are not visible in the source code, there is no user control for them in the createuserwizard.
Oct 02, 2006 02:24 PM|rjstinyc|LINK
Yes the article is fairly general concerning localization. I was not aware that you were trying to localize
explicitly. I was able to implicitly localize user buttons in the CreateUserWizard i.e Create to Creéz in English and French for my purposes. I am fairly new to the ASP.NET platform so pardon me if I did not grasp your question.
Oct 03, 2006 12:30 PM|Eilon|LINK
In Page_Init/Load or wherever do this:
MyWizard.CreateUserButtonText = GetLocalResourceObject("myresourcename");
Oct 04, 2006 09:08 AM|Flax|LINK
Thanks everybody now everything works perfectly. Just a little improvement to your code Eilon, converting the object into string:
MyWizard.CreateUserButtonText = GetLocalResourceObject("myresourcename").ToString();