/// <summary> /// Writes an opening form tag to the response. When the user submits the form, /// the request will be processed by the route target. /// </summary> /// <param name="htmlHelper">The HTML helper.</param> /// <param name="routeName">The name of the route to use to obtain the form-post URL.</param> /// <param name="method">The HTTP method for processing the form, either GET or POST.</param> /// <param name="routeValues">An object that contains the parameters for evaluatedValueString route.</param> /// <param name="htmlAttributes">The HTTP method for processing the form, either GET or POST.</param> /// <returns>An opening form tag.</returns> public static IDisposable BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method = FormMethod.Post, object routeValues = null, object htmlAttributes = null) { var routeDictionary = htmlHelper.AutomaticRouteValuesDictionary(routeValues); var attrDictionary = htmlHelper.AutomaticHtmlAttributes(htmlAttributes); return BootstrapHelperConfiguration.HtmlRenderer.BeginRouteForm(htmlHelper, routeName, method, routeDictionary, attrDictionary); }
/// <summary> /// Returns an anchor element (evaluatedValueString element) that contains the virtual path of the /// specified action. /// </summary> /// <param name="htmlHelper">The HTML helper.</param> /// <param name="linkText">The inner text of the anchor element.</param> /// <param name="routeName">The name of the route that is used to return evaluatedValueString virtual path.</param> /// <param name="protocol">The protocol for the URL, such as "http" or "https".</param> /// <param name="hostName">The host name for the URL.</param> /// <param name="fragment">The URL fragment name (the anchor name).</param> /// <param name="routeValues">An object that contains the parameters for evaluatedValueString route.</param> /// <param name="htmlAttributes">An object that contains the HTML attributes to set for the element.</param> /// <returns>An anchor element (evaluatedValueString element).</returns> public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName = null, string protocol = null, string hostName = null, string fragment = null, object routeValues = null, object htmlAttributes = null) { if (string.IsNullOrEmpty(linkText)) throw new ArgumentNullException("linkText"); var routeDictionary = htmlHelper.AutomaticRouteValuesDictionary(routeValues); var attrDictionary = htmlHelper.AutomaticHtmlAttributes(htmlAttributes); return BootstrapHelperConfiguration.HtmlRenderer.RouteLink(htmlHelper, linkText, routeName, protocol, hostName, fragment, routeDictionary, attrDictionary); }