示例#1
0
 public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxFormOptions ajaxOptions, IDictionary <string, object> htmlAttributes)
 {
     // get target URL
     return(FormHelper(htmlHelper, actionName, controllerName, ajaxOptions, htmlAttributes));
 }
示例#2
0
 private static MvcForm FormHelper(this IHtmlHelper htmlHelper, string actionName, string controllerName, AjaxFormOptions ajaxOptions, IDictionary <string, object> htmlAttributes)
 {
     htmlAttributes = htmlAttributes ?? new Dictionary <string, object>();
     if (ajaxOptions != null)
     {
         htmlAttributes = htmlAttributes.Union(ajaxOptions.ToUnobtrusiveHtmlAttributes()).ToDictionary(c => c.Key, c => c.Value);
     }
     return(htmlHelper.BeginForm(actionName, controllerName, FormMethod.Post, htmlAttributes));
 }
示例#3
0
 public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxFormOptions ajaxOptions)
 {
     return(AjaxBeginForm(htmlHelper, actionName, controllerName, routeValues, ajaxOptions, null /* htmlAttributes */));
 }
示例#4
0
        public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, AjaxFormOptions ajaxOptions, object htmlAttributes)
        {
            RouteValueDictionary newValues = new RouteValueDictionary(routeValues);
            var newAttributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);

            return(AjaxBeginForm(htmlHelper, actionName, controllerName, newValues, ajaxOptions, newAttributes));
        }
示例#5
0
 public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, string actionName, RouteValueDictionary routeValues, AjaxFormOptions ajaxOptions, IDictionary <string, object> htmlAttributes)
 {
     return(AjaxBeginForm(htmlHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions, htmlAttributes));
 }
示例#6
0
 public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, string actionName, object routeValues, AjaxFormOptions ajaxOptions)
 {
     return(AjaxBeginForm(htmlHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions));
 }
示例#7
0
        public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, AjaxFormOptions ajaxOptions)
        {
            string formAction = htmlHelper.ViewContext.HttpContext.Request.GetEncodedUrl();

            return(FormHelper(htmlHelper, formAction, "", ajaxOptions, new RouteValueDictionary()));
        }