Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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 */));
 }
Beispiel #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));
        }
Beispiel #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));
 }
Beispiel #6
0
 public static MvcForm AjaxBeginForm(this IHtmlHelper htmlHelper, string actionName, object routeValues, AjaxFormOptions ajaxOptions)
 {
     return(AjaxBeginForm(htmlHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions));
 }
Beispiel #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()));
        }