XSL: Turning Off XML Declaration

When using the system.web.ui.webcontrols.xml control to transform an xml file to html (using an xsl stylesheet), the control was adding a <?xml version=”1.0″ ?> declaration to the output. To turn this off, simple add the following to your xsl transform (inside the xsl:stylesheet node, but outside of any xsl:template nodes).

<xsl:output method=”xml” omit-xml-declaration=”yes”/>

Quicknote: Adding a CSS reference from code

To add a CSS reference from in code, simply do the following:

protected void Page_Init(object sender, EventArgs e)
{
    HtmlLink link = new HtmlLink();
    link.Href = “mystylesheet.css”;
    link.Attributes.Add(“rel”, “stylesheet”);
    link.Attributes.Add(“type”, “text/css”);
    Page.Header.Controls.Add(link);
}