AI OnAI Off
if (PersonalizedData.Current != null)
e.Page["Writername"] = PersonalizedData.Current.DisplayName;
Steve
[EPiServer.PlugIn.PageDefinitionTypePlugIn(DisplayName="Page responsible")]
public class userName:PropertyString
{
public override void CreateChildControls(
string renderType, System.Web.UI.Control container)
{
UnifiedPrincipal user = UnifiedPrincipal.Current;
switch(renderType)
{
case "edit":
TextBox txt = new TextBox();
txt.ID = this.Name;
txt.Width = 270;
CopyWebAttributes(container,txt);
if (user != null && user.Identity.IsAuthenticated)
txt.Text = user.UserData.FirstName +
" " + user.UserData.LastName;
if ((string)base.Value != null)
txt.Text = base.Value.ToString();
container.Controls.Add(txt);
container.Controls.Add(CreateParseValidator(txt));
break;
default:
base.CreateChildControls(renderType,container);
break;
}
}
}