private static WebControl makeGeneralEmail(Email email) { Panel emailDiv = new Panel(); emailDiv.CssClass += "email"; if (email.emailType != null && !email.emailType.Equals("")) { Label emailType = new Label(); emailType.CssClass += "type"; emailType.Font.Italic = true; emailType.Controls.Add(new LiteralControl("(")); HtmlControl emailTypeAbbr = new HtmlGenericControl("abbr"); emailTypeAbbr.Attributes.Add("class", "type"); emailTypeAbbr.Attributes.Add("title", email.emailType.ToLower()); emailTypeAbbr.Controls.Add(new LiteralControl(email.emailType)); emailType.Controls.Add(new LiteralControl(")")); emailDiv.Controls.Add(emailType); } emailDiv.Controls.Add(makeEmail(email)); //emailDiv.Controls.Add(new WebControl(HtmlTextWriterTag.Br)); return emailDiv; }
private static WebControl makePersonEmail(Email email, String personFirstName) { Panel emailDiv = new Panel(); emailDiv.CssClass += "email"; Label emailType = new Label(); //emailType.CssClass += "type"; emailType.Font.Italic = true; if (email.emailType != null && !email.emailType.Equals("")) { HtmlControl emailTypeAbbr = new HtmlGenericControl("abbr"); emailTypeAbbr.Attributes.Add("class", "type"); emailTypeAbbr.Attributes.Add("title", email.emailType.ToLower()); emailTypeAbbr.Controls.Add(new LiteralControl(email.emailType)); emailType.Controls.Add(new LiteralControl(personFirstName)); emailType.Controls.Add(new LiteralControl("—")); emailType.Controls.Add(emailTypeAbbr); emailType.Controls.Add(new LiteralControl(": ")); } else emailType.Text = personFirstName + ": "; emailDiv.Controls.Add(emailType); emailDiv.Controls.Add(makeEmail(email)); //emailDiv.Controls.Add(new WebControl(HtmlTextWriterTag.Br)); return emailDiv; }
private static Control makeEmail(Email email) { HyperLink address = new HyperLink(); address.CssClass += "value"; address.NavigateUrl = "mailto:" + email.emailAddress; address.Text = email.emailAddress; return address; }