views:

54

answers:

1

Hi,

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.Routing.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?

+2  A: 

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)) { %>
David Ebbo
thanks david, worked perfectly.
mickdelaney