Memo to self:
"When injecting controls from code behind in a Visual Web Part in SharePoint 2013, use the Page Load event, not the CreateChildControls().
Example:
------------------------------------------------------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
this.EnsureChildControls();
this.Controls.Add(new LiteralControl("<span></span>"));
}
------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment