Exemplo n.º 1
0
 /// <summary>
 /// The <c>&lt;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>&lt;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>&#8204;&#009;&#8204;&#009;&#8204;&#009;
 /// &#8226; An unvisited link is underlined and blue <remarks></remarks>&#8204;&#009;&#8204;&#009;&#8204;&#009;
 /// &#8226; A visited link is underlined and purple <remarks></remarks>&#8204;&#009;&#8204;&#009;&#8204;&#009;
 /// &#8226; 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 | &lt;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);
 }
Exemplo n.º 2
0
 /// <summary>
 /// The <c>&lt;button></c> tag defines a clickable button.<remarks></remarks>
 /// Inside a <c>&lt;button></c> element you can put content, like text or images. <remarks></remarks>
 /// This is the difference between this element and buttons created with the <c>&lt;input></c> element. <remarks></remarks>
 /// Tip: Always specify the type attribute for a <c>&lt;button></c> element. Different browsers use different default types for the <c>&lt;button></c> element. <remarks> </remarks>
 /// 
 /// For more information see: <see cref="http://www.w3schools.com/tags/tag_button.asp"/>
 /// </summary>
 /// <param name="builder">Builder for the Html Component</param>
 /// <param name="value">The text value of the button</param>
 /// <param name="name">Specifies a name for the button<c> [name]</c> (optional)</param>
 /// <param name="type">
 ///     Specifies the type of button<c> [type="button | submit | reset "]</c> (optional) <remarks></remarks>
 ///     If left blank, it will default to <see cref="InputType.ButtonTypes.Button"/>
 /// </param>
 /// <param name="formTarget">The window target<c> [target="_blank | _parent | _self | _top | &lt;frameName>"]</c> (optional)</param>
 /// <param name="attributes">Standard HTML Attributes (optional)</param>
 /// <returns></returns>
 public static IHtmlElement Button(this IBuilder builder, 
     string value, 
     string name = null,
     FormButtonType type = null,
     HyperLinkTarget formTarget = null, 
     HtmlAttributes attributes = null)
 {
     var newAttributes = attributes ?? new HtmlAttributes();
     if(!String.IsNullOrWhiteSpace(name)) newAttributes.Add("name", name);
     newAttributes.Add("type", (type ?? InputType.ButtonTypes.Button).ToString());
     if(formTarget != null) newAttributes.Add("formTarget", formTarget.ToString());
     return ButtonElement(builder, newAttributes).SetText(value);
 }