public virtual string GetScriptFilled(bool includeScriptTag, bool loadMinIfAvailable, bool validate, bool throwException, out string retMessage)
{
string message = null;
StringBuilder script = new StringBuilder();
try
{
string scriptTemplate = GetScript(loadMinIfAvailable, validate, throwException, out message);
if (includeScriptTag ==true)
{
script.Append(ResourceUtil.ScriptMarkupStart);
script.Append(Environment.NewLine);
}
if ((string.IsNullOrEmpty(scriptTemplate) ==false) && ((validate ==false) || IsScriptValid(throwException, out message)))
{
scriptTemplate = scriptTemplate.Replace("/*!@ServiceUrl@*/", string.IsNullOrEmpty(ScriptServiceUrl)==false ? ScriptServiceUrl : "");
}
script.Append(scriptTemplate);
if (includeScriptTag ==true)
{
script.Append(Environment.NewLine);
script.Append(ResourceUtil.ScriptMarkupEnd);
}
}
catch (Exception ex)
{
message = "Error:" + ex.Message;
if (throwException) throw;
}
retMessage = message;
return script.ToString();
}