Friday, 8 January 2010

Added Alex Gorbatchev’s Syntax Highlighter to my blog

Just added new syntax highlighting that uses Alex Gorbatchev SyntaxHighlighter similar to the one on MSDN blogs and ASP.Net Dynamic Data forum also I’m using Prabir Shrestha's Windows Live Writer Syntax Highlighter also here is a blog post about adding the hosted JavaScript to Blogger, I must mention Kyle Savant who got it working with blogger first and sent me the how to Open-mouthed

protected override void OnInit(EventArgs e)
{
    linkButtonId = this.UniqueID + "_Button";

    // Define the name and type of the client scripts on the page.
    string scriptName = "NotAClue.Web.UI.WebControls.ResourceFiles.NAC_OpenPopup.js";
    Type scriptType = this.GetType();

    // Get a ClientScriptManager reference from the Page class.
    ClientScriptManager csm = Page.ClientScript;

    // Check to see if the Client Script Include is already registered.
    if (!csm.IsClientScriptIncludeRegistered(scriptType, scriptName))
    {
        // include main Flash Content script
        string urlJS = csm.GetWebResourceUrl(scriptType, scriptName);
        csm.RegisterClientScriptInclude(scriptType, scriptName, urlJS);
    }

    base.OnInit(e);
}

Listing 1 – Sample listing.

No comments: