locked
Cannot change duplicateUserNameError Member of CreateUserWizard RRS feed

  • Question

  • User-1190852853 posted
    Hi,

    I am localizing a site by overriding the tags as per the method shown here :

     http://www.codeproject.com/aspnet/localization_websites.asp

    When overriding the CreateUserWizard I wish to set the value for DuplicateUserNameErrorMessage programatically. I can do this in the code behind file using :

     

    CreateUserWizard1.DuplicateUserNameErrorMessage = ResourceManager.GetString("duplicateusernameerror");

     
     and this works fine. However If i try to do this in a class which overrides CreateUserWizard, sample bits of code below :

     

    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace Localization {
        public class LocalizedCreateUserWizard : CreateUserWizard, ILocalized
        {
    
         #region fields and properties
          private string key;
    
            private string DuplicateUserNameError;
    
          public string Key {
             get { return key; }
             set { key = value; }
          }
    
            public string duplicateUserNameError
            {
                get { return DuplicateUserNameError; }
                set { DuplicateUserNameError = value; }
            }
     
          #endregion
    
          protected override void Render(HtmlTextWriter writer) {
    
              base.DuplicateUserNameErrorMessage = ResourceManager.GetString(DuplicateUserNameError);
    
             base.Render(writer);
          }
       }
    }

      

    using my localized createwizard on the front end :

     

     

    <Localized:LocalizedCreateUserWizard key="<span" class="st">"createuser" 
            duplicateUserNameError="duplicateusernameerror"
            OnFinishButtonClick="OnFinishButtonClick" ID="CreateUserWizard1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" Height="241px" Width="674px" CreateUserButtonText="Send" >
              </Localized:LocalizedCreateUserWizard>

      it doesnt work and I just cannot figure out why? I get no errors, but the value is just the default english value. Can anyone shed any light on this?

    Thanks,

    Thursday, May 3, 2007 9:45 PM

Answers

  • User-1190852853 posted

    I could only resolve this by accessing the property from the code behind file, rather than an argument in the control on the aspx page. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 16, 2007 9:30 PM