当前位置: 首页>>代码示例>>C#>>正文


C# this.BeginRouteForm方法代码示例

本文整理汇总了C#中this.BeginRouteForm方法的典型用法代码示例。如果您正苦于以下问题:C# this.BeginRouteForm方法的具体用法?C# this.BeginRouteForm怎么用?C# this.BeginRouteForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在this的用法示例。


在下文中一共展示了this.BeginRouteForm方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BeginResourceForm

 /// <summary>
 /// Generates the Form preamble
 /// </summary>
 /// <param name="html"></param>
 /// <param name="controllerName"></param>
 /// <param name="routeValues"></param>
 /// <param name="htmlAttributes"></param>
 /// <param name="actionType"></param>
 /// <returns></returns>
 public static MvcForm BeginResourceForm(this HtmlHelper html, string controllerName, object routeValues, object htmlAttributes, ActionType actionType) {
     switch (actionType) {
         case ActionType.GetUpdateForm:
             return html.BeginRouteForm(controllerName + "-editForm", routeValues, FormMethod.Post, htmlAttributes);
         case ActionType.GetCreateForm:
             return html.BeginRouteForm(controllerName + "-createForm", FormMethod.Post, htmlAttributes);
         case ActionType.Retrieve:
         case ActionType.Delete:
         case ActionType.Update:
             return html.BeginRouteForm(controllerName, routeValues, FormMethod.Post, htmlAttributes);
         case ActionType.Create:
             return html.BeginRouteForm(controllerName + "-create", FormMethod.Post, htmlAttributes);
         case ActionType.Index:
             return html.BeginRouteForm(controllerName + "-index", FormMethod.Post, htmlAttributes);
         default:
             throw new ArgumentOutOfRangeException("actionType");
     }
 }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:27,代码来源:HtmlHelperExtensions.cs

示例2: BeginResourceForm

 /// <summary>
 /// Generates the Form preamble
 /// </summary>
 /// <param name="ajax"></param>
 /// <param name="controllerName"></param>
 /// <param name="routeValues"></param>
 /// <param name="ajaxOptions"></param>
 /// <param name="actionType"></param>
 /// <returns></returns>
 public static MvcForm BeginResourceForm(this AjaxHelper ajax, string controllerName, object routeValues, AjaxOptions ajaxOptions, ActionType actionType) {
     switch (actionType) {
         case ActionType.GetUpdateForm:
             return ajax.BeginRouteForm(controllerName + "-editForm", routeValues, ajaxOptions);
         case ActionType.GetCreateForm:
             return ajax.BeginRouteForm(controllerName + "-createForm", ajaxOptions);
         case ActionType.Retrieve:
         case ActionType.Delete:
         case ActionType.Update:
             // can we use ajaxOptions to either add the header?
             MvcForm form = ajax.BeginRouteForm(controllerName, routeValues, ajaxOptions);
             return form;
         case ActionType.Create:
             return ajax.BeginRouteForm(controllerName + "-create", ajaxOptions);
         case ActionType.Index:
             return ajax.BeginRouteForm(controllerName + "-index", ajaxOptions);
         default:
             throw new ArgumentOutOfRangeException("actionType");
     }
 }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:29,代码来源:AjaxHelperExtensions.cs

示例3: BeginERPStoreRouteForm

 public static MvcForm BeginERPStoreRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues, FormMethod method)
 {
     routeName = htmlHelper.ResolveRouteName(routeName);
     return htmlHelper.BeginRouteForm(routeName, routeValues, method);
 }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:5,代码来源:RouteExtensions.cs

示例4: BeginRouteTokenForm

 public static MvcForm BeginRouteTokenForm(this HtmlHelper htmlHelper, string routeName)
 {
     var mvcForm = htmlHelper.BeginRouteForm(routeName);
     htmlHelper.ViewContext.Writer.Write(htmlHelper.AntiForgeryToken().ToHtmlString());
     return mvcForm;
 }
开发者ID:hardCTE,项目名称:EasyFrameWork,代码行数:6,代码来源:ExMvcForm.cs

示例5: BeginRouteForm

        /// <summary>
        /// Renders a &lt;form&gt; start tag to the response. The route with name <paramref name="routeName"/>
        /// generates the &lt;form&gt;'s <c>action</c> attribute value.
        /// </summary>
        /// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
        /// <param name="routeName">The name of the route.</param>
        /// <param name="method">The HTTP method for processing the form, either GET or POST.</param>
        /// <param name="htmlAttributes">
        /// An <see cref="object"/> that contains the HTML attributes for the element. Alternatively, an
        /// <see cref="System.Collections.Generic.IDictionary{string, object}"/> instance containing the HTML
        /// attributes.
        /// </param>
        /// <returns>
        /// An <see cref="MvcForm"/> instance which renders the &lt;/form&gt; end tag when disposed.
        /// </returns>
        /// <remarks>
        /// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>.
        /// </remarks>
        public static MvcForm BeginRouteForm(
            this IHtmlHelper htmlHelper,
            string routeName,
            FormMethod method,
            object htmlAttributes)
        {
            if (htmlHelper == null)
            {
                throw new ArgumentNullException(nameof(htmlHelper));
            }

            return htmlHelper.BeginRouteForm(
                routeName,
                routeValues: null,
                method: method,
                htmlAttributes: htmlAttributes);
        }
开发者ID:huoxudong125,项目名称:Mvc,代码行数:35,代码来源:HtmlHelperFormExtensions.cs

示例6: BeginRouteForm

 /// <summary>
 /// Writes an opening &lt;form&gt; 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 instance that this method extends.</param>
 /// <param name="routeName">The name of the route to use to obtain the form-post URL.</param>
 /// <param name="attributeExpression">An expression that contains the HTML attributes to set for the element.</param>
 /// <returns>An opening &lt;form&gt; tag.</returns>
 public static MvcForm BeginRouteForm( this HtmlHelper htmlHelper, string routeName, Action<HtmlAttributeBuilder> attributeExpression )
 {
     return htmlHelper.BeginRouteForm( routeName, null, FormMethod.Post, attributeExpression.GetAttributes() );
 }
开发者ID:john-t-white,项目名称:Hex,代码行数:11,代码来源:FormExtensions.cs

示例7: BeginRouteForm

 public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, Task<ActionResult> taskResult, AjaxOptions ajaxOptions)
 {
     return ajaxHelper.BeginRouteForm(routeName, taskResult.Result, ajaxOptions, null);
 }
开发者ID:Ezeckiel2517,项目名称:T4MVC,代码行数:4,代码来源:T4Extensions.cs

示例8: FormRoute

 public static IDisposable FormRoute(this HtmlHelper html, string routeName, FormMethod method, RouteValueDictionary valuesDictionary)
 {
     VirtualPathData virtualPath = RouteTable.Routes.GetVirtualPath(html.ViewContext.RequestContext, routeName, valuesDictionary);
     string formAction = (virtualPath == null) ? null : virtualPath.VirtualPath;
     return html.BeginRouteForm(routeName, method, valuesDictionary);
 }
开发者ID:JoeyCyril,项目名称:BoC,代码行数:6,代码来源:FormExtensions.cs

示例9: BeginLocalizedRouteForm

 public static MvcForm BeginLocalizedRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues,  FormMethod method)
 {
     var currentLanguage = GetCurrentLanguage(htmlHelper);
     routeName = string.Format("{0}-{1}", routeName, currentLanguage);
     return htmlHelper.BeginRouteForm(routeName, routeValues, method);
 }
开发者ID:hhariri,项目名称:ReSharper8Demo,代码行数:6,代码来源:LocalizedExtensions.cs

示例10: SecureBeginRouteForm

 public static MvcForm SecureBeginRouteForm(this HtmlHelper htmlHelper, string routeName, ActionResult result, FormMethod method, IDictionary<string, object> htmlAttributes)
 {
     return htmlHelper.BeginRouteForm(routeName, result.GetRouteValueDictionary(), method, htmlAttributes);
 }
开发者ID:rabbal,项目名称:Decision,代码行数:4,代码来源:T4SecureExtensions.cs

示例11: BeginRouteForm

        /// <summary>
        /// Renders a &lt;form&gt; start tag to the response. The route with name <paramref name="routeName"/>
        /// generates the &lt;form&gt;'s <c>action</c> attribute value.
        /// </summary>
        /// <param name="htmlHelper">The <see cref="IHtmlHelper"/> instance this method extends.</param>
        /// <param name="routeName">The name of the route.</param>
        /// <param name="suppressAntiforgery">
        /// If <c>true</c>, suppresses the generation an &lt;input&gt; of type "hidden" with an antiforgery token. By
        /// default &lt;form&gt; elements will automatically include an antiforgery token.
        /// </param>
        /// <returns>
        /// An <see cref="MvcForm"/> instance which renders the &lt;/form&gt; end tag when disposed.
        /// </returns>
        /// <remarks>
        /// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>.
        /// </remarks>
        public static MvcForm BeginRouteForm(this IHtmlHelper htmlHelper, string routeName, bool suppressAntiforgery)
        {
            if (htmlHelper == null)
            {
                throw new ArgumentNullException(nameof(htmlHelper));
            }

            return htmlHelper.BeginRouteForm(
                routeName,
                routeValues: null,
                method: FormMethod.Post,
                suppressAntiforgery: suppressAntiforgery,
                htmlAttributes: null);
        }
开发者ID:phinq19,项目名称:git_example,代码行数:30,代码来源:HtmlHelperFormExtensions.cs


注:本文中的this.BeginRouteForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。