Sunday, February 3, 2013

How to override a default child control.

 System.Web.UI.WebControls.WebParts.WebPart {

    public override void CreateChildControls() {
        Label label = new Label();
        label.Text = "Hello World!";
        this.Controls.Add(label);
        base.CreateChildControls();
    }
}
How to allow inline code in a SharePoint site page.
Add the following to the application page web.config

<PageParserPath
    VirtualPath="/Library/*"
    CompilationMode="Always"
    AllowServerSideScript="true"
    IncludeSubFolders="true" />