public virtual void RenderErrorsList(HtmlTextWriter writer) { if (HasNonAborts(_errorList)) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "errorlist"); writer.AddAttribute(HtmlTextWriterAttribute.Id, "errorlist"); writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "HideError(this)"); writer.RenderBeginTag(HtmlTextWriterTag.Div); bool first = true; foreach (Exception exception in _errorList) { if (!(exception is AbortException)) { if (first) { first = false; } else { writer.Write("<br>"); } ShowErrorsForm.RenderError(writer, exception); } } writer.RenderEndTag(); _errorList.Clear(); } }
public void ShowFormWarnings(ErrorList errors) { IHost host = CreateHost(); try { ShowErrorsForm form = new ShowErrorsForm(Strings.Get("CFormLoadWarningsCaption")); try { host.Children.Add(form); form.Errors = errors; host.Open(); form.Show(); } catch { form.Dispose(); throw; } } catch { host.Dispose(); throw; } }
public virtual void RenderRenderError(HtmlTextWriter writer, Exception exception) { writer.RenderBeginTag(HtmlTextWriterTag.Br); writer.RenderEndTag(); writer.Write(HttpUtility.HtmlEncode(Strings.Get("RenderErrorIntro"))); ShowErrorsForm.RenderError(writer, exception); writer.RenderBeginTag(HtmlTextWriterTag.Br); writer.RenderEndTag(); _errorList.Clear(); }