Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Setting the UserNameText to blank View modes: 
User avatar
Member
Member
c.s.leonard-gmail - 10/1/2010 12:54:43 PM
   
Setting the UserNameText to blank
In the webpart under Member/LogonMiniForm, there is a property "UserNameText" that has the following code in the setter:

   public string UserNameText
{
get
{
return ValidationHelper.GetString(GetValue("UserNameText"), mUserNameText);
}
set
{
if (value.Trim() != string.Empty)
{
SetValue("UserNameText", value);
mUserNameText = value;
}
}
}


I need to set the text to empty. I could comment out the if(conditional check) so that it sets the empty string, but I'd like to know if there's a better way(as this may impact functionality in other places, not to mention upgrade issues).

User avatar
Member
Member
kentico_michal - 10/8/2010 5:10:56 AM
   
RE:Setting the UserNameText to blank
Hi,

I suppose you want to display empty string in user name text box.

You could set Username text: property in web part properties to empty string.

Another way could be modifying SetupControl method in ~\CMSWebParts\Membership\Logon\LogonMiniForm.ascx.cs file in following way:

if (string.IsNullOrEmpty(loginElem.UserName))
{
//loginElem.UserName = UserNameText;
loginElem.UserName = "";
}


Best regards,
Michal Legen