Ejemplo n.º 1
0
        public static void UpdateFormBuilderContext(this HtmlHelper htmlHelper, Action <FormBuilderContext> updateAction)
        {
            if (updateAction == null)
            {
                return;
            }
            FormBuilderContext formBuilderContext = htmlHelper.GetFormBuilderContext();

            updateAction(formBuilderContext);
            htmlHelper.SetFormBuilderContext(formBuilderContext);
        }
Ejemplo n.º 2
0
        public static FormBuilderContext GetFormBuilderContext(this HtmlHelper htmlHelper)
        {
            IDictionary items = htmlHelper.ViewContext.HttpContext.Items;

            FormBuilderContext builderContext = null;

            if (items.Contains(FormBuilderContextKey))
            {
                builderContext = items[FormBuilderContextKey] as FormBuilderContext;
            }

            if (builderContext == null)
            {
                builderContext = new FormBuilderContext();
                items[FormBuilderContextKey] = builderContext;
            }

            return(builderContext);
        }
Ejemplo n.º 3
0
        public static FormBuilderContext GetFormBuilderContext(this HtmlHelper htmlHelper)
        {
            IDictionary items = htmlHelper.ViewContext.HttpContext.Items;

            FormBuilderContext builderContext = null;
            if (items.Contains(FormBuilderContextKey))
            {
                builderContext = items[FormBuilderContextKey] as FormBuilderContext;
            }

            if (builderContext == null)
            {
                builderContext = new FormBuilderContext();
                items[FormBuilderContextKey] = builderContext;
            }

            return builderContext;
        }
Ejemplo n.º 4
0
 public static void SetFormBuilderContext(this HtmlHelper htmlHelper, FormBuilderContext builderContext)
 {
     htmlHelper.ViewContext.HttpContext.Items[FormBuilderContextKey] = builderContext;
 }
Ejemplo n.º 5
0
 public static void SetFormBuilderContext(this HtmlHelper htmlHelper, FormBuilderContext builderContext)
 {
     htmlHelper.ViewContext.HttpContext.Items[FormBuilderContextKey] = builderContext;
 }