public static BeginTag ToBeginForm(this RouteValueDictionary htmlAttributes, HtmlHelper htmlHelper, string url, HttpVerbs method = HttpVerbs.Post, Enctype enctype = Enctype.ApplicationXWWWFormUrlEncoded ) { if (!htmlAttributes.ContainsKey(HtmlAttribute.Method.ToStringLower())) { htmlAttributes.Set(HtmlAttribute.Method.ToStringLower(), method.ToStringLower()); } if (!htmlAttributes.ContainsKey(HtmlAttribute.Enctype.ToStringLower())) { htmlAttributes.Set(HtmlAttribute.Enctype.ToStringLower(), enctype.ToLocalization()); } if (!htmlAttributes.ContainsKey(HtmlAttribute.Action.ToStringLower())) { htmlAttributes.Set(HtmlAttribute.Action.ToStringLower(), url); } return(htmlAttributes.ToBeginTag(HtmlTag.Form)); }