/// <summary> /// /// </summary> /// <param name="renderer"></param> /// <param name="keyAttribute"></param> protected void OutputRenderer(IBaseRenderer renderer, string keyAttribute) { Response.Clear(); Response.AddHeader("Content-Disposition", "attachment;filename=\"" + renderer.GetFileName() + "\""); Response.ContentType = renderer.GetMimeType(); Response.Write(renderer.Render(keyAttribute)); Response.End(); // required or sometimes will show inline }
/// <summary> /// /// </summary> /// <param name="renderer"></param> /// <param name="keyAttribute"></param> protected void OutputMultiRenderer(Object [] renderers, string keyAttribute, bool isClerkingServices) { Response.Clear(); if (renderers.Length > 0) { bool contentTypeSet = false; IEnumerator i = renderers.GetEnumerator(); while (i.MoveNext()) { IBaseRenderer renderer = (IBaseRenderer)i.Current; if (renderer == null) { continue; } if (!contentTypeSet) { Response.AddHeader("Content-Disposition", "attachment;filename=\"" + renderer.GetFileName() + "\""); Response.ContentType = renderer.GetMimeType(); contentTypeSet = true; } Response.Write(renderer.Render(keyAttribute)); } if (isClerkingServices) { Response.Write("Clerking Services=Yes\n"); } } Response.End(); // required or sometimes will show inline }