开发者

RouteValueDictionary in querystring with t4mvc?

开发者 https://www.devze.com 2023-01-06 04:55 出处:网络
Whenever I use t4Mvc to create a form post Url, e.g. <% using (Html.BeginForm(MVC.Admin.Login.Index())) { %>

Whenever I use t4Mvc to create a form post Url, e.g.

<% using (Html.BeginForm(MVC.Admin.Login.Index())) { %>

It generates a route like the following:

<form method="post" action="/admin/login/index?RouteValueDictionary=System.Web.Ro开发者_如何学JAVAuting.RouteValueDictionary">

or when i use

<% using (Html.BeginForm(MVC.Admin.Login.Index(null))) { %> 

where the method is expecting an action parameter it generates

<form method="post" action="/admin/login?TempData=System.Web.Mvc.TempDataDictionary&amp;ViewData=System.Web.Mvc.ViewDataDictionary&amp;ViewEngineCollection=System.Web.Mvc.ViewEngineCollection">

Anyone else had this issue?


I see, this happens because the T4MVC overload needs the form method to be explicitly passed in. e.g. try

<% using (Html.BeginForm(MVC.Admin.Login.Index(), FormMethod.Post)) { %>
0

精彩评论

暂无评论...
验证码 换一张
取 消