/**
     * Compile script
     */
    private void CompileScript(HtmlTextWriter writer)
    {
        try
        {
            string folderPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "Composite");

            string targetPath = folderPath + "\\scripts\\compressed";


            ScriptHandler.MergeScripts(type, _defaultscripts, folderPath, targetPath);
            if (type == "top")
            {
                ScriptHandler.BuildTopLevelClassNames(_defaultscripts, folderPath, targetPath);
            }
        }
        catch (Exception e)
        {
            Composite.Core.Logging.LoggingService.LogError(typeof(ScriptLoaderControl).FullName, new InvalidOperationException("Failed to compile scripts", e));

            writer.Write("<p> Failed to compile scripts. Exception text:");
            writer.Write(HttpUtility.HtmlEncode(e.ToString()));
            writer.Write("</p>");
        }
    }