private void ShowError(HttpContextBase httpContext, string message) { var response = httpContext.Response; response.StatusCode = (int)HttpStatusCode.BadRequest; using (var writer = new HtmlTextWriter(response.Output)) { writer .Attribute(HtmlTextWriterAttribute.Style, "font-family:helvetica; padding:20px;") .Begin(HtmlTextWriterTag.Div) .Attribute(HtmlTextWriterAttribute.Src, "https://raw.github.com/poulfoged/little-convoy/master/graphics/LittleConvoy%20Logo.png") .Attribute(HtmlTextWriterAttribute.Alt, "LittleConvoy") .Full(HtmlTextWriterTag.Img) .Full(HtmlTextWriterTag.H3, "This service should be called via a LittleConvoy-client.") .Full(HtmlTextWriterTag.P, "The request did not succeed:") .Attribute(HtmlTextWriterAttribute.Style, "background-color:#ddd;padding:10px") .Full(HtmlTextWriterTag.Code, message) .Begin(HtmlTextWriterTag.P, "See more at ") .Attribute(HtmlTextWriterAttribute.Href, "https://github.com/poulfoged/little-convoy") .Full(HtmlTextWriterTag.A, "GitHub") .End("."); } response.End(); }