protected virtual void RenderScript(string script)
{
ResourceManager rm = ResourceManager.GetInstance(HttpContext.Current);
if (HttpContext.Current.CurrentHandler is Page && rm != null)
{
rm.AddScript(script);
}
else
{
new DirectResponse(script).Return();
}
}