public static IHtmlElement Link(this IBuilder builder, Uri sourceReference, IHtmlAttributes attributes = null) { var newAttributes = attributes ?? new HtmlAttributes(); newAttributes.Add("src", sourceReference.ToString()); newAttributes.Add("rel", LinkRelationType.StyleSheet.ToString()); return LinkElement(builder, newAttributes); }
public static IHtmlElement Script(this IBuilder builder, Uri sourceReference, ScriptSourceType sourceType, IHtmlAttributes attributes = null) { var newAttributes = attributes ?? new HtmlAttributes(); newAttributes.Add("src", sourceReference.ToString()); newAttributes.Add("type", sourceType.ToString()); return ScriptElement(builder, newAttributes); }
/// <summary> /// The <c><a></c> tag defines a hyperlink, which is used to link from one page to another. <remarks></remarks> /// The most important attribute of the <c><a></c> element is the href attribute, which indicates the link's destination. <remarks></remarks> /// By default, links will appear as follows in all browsers: <remarks></remarks>‌	‌	‌	 /// • An unvisited link is underlined and blue <remarks></remarks>‌	‌	‌	 /// • A visited link is underlined and purple <remarks></remarks>‌	‌	‌	 /// • An active link is underlined and red <remarks> </remarks> /// /// For more information see: <see cref="http://www.w3schools.com/tags/tag_a.asp"/> /// </summary> /// <param name="builder">Builder for the Html Component</param> /// <param name="address">The URI where the HyperLink should refer to<c> [href]</c></param> /// <param name="target">The window target<c> [target="_blank | _parent | _self | _top | <frameName>"]</c> (optional)</param> /// <param name="attributes">Standard HTML Attributes (optional)</param> /// <returns></returns> public static IHtmlElement HyperLink(this IBuilder builder, Uri address, HyperLinkTarget target = null, HtmlAttributes attributes = null) { var newAttributes = attributes ?? new HtmlAttributes(); newAttributes.Add("href", address.ToString()); if(target != null) newAttributes.Add("target", target.ToString()); return builder.Anchor(newAttributes); }