Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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;
}
}
}