I am trying to use the Html.Form helper to create a file upload form like this...
<% using (Html.Form("MyController", "MyAction", FormMethod.Post, new { @class = "normal" })) %>
But it fails to compile! with this error ...
Compiler Error Message: CS1928: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Form' and the best extension method overload 'System.Web.Mvc.FormExtensions.Form(System.Web.Mvc.HtmlHelper, string, string, System.Web.Mvc.FormMethod, System.Collections.Generic.IDictionary<string,object>)'
has some invalid arguments
aktxyz
Member
2 Points
27 Posts
Html.Form and enctype = "multipart/form-data"
Aug 29, 2008 09:35 PM|LINK
I am trying to use the Html.Form helper to create a file upload form like this...
<% using (Html.Form("MyController", "MyAction", FormMethod.Post, new { @class = "normal" })) %>
But it fails to compile! with this error ...
Compiler Error Message: CS1928: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Form' and the best extension method overload 'System.Web.Mvc.FormExtensions.Form(System.Web.Mvc.HtmlHelper, string, string, System.Web.Mvc.FormMethod, System.Collections.Generic.IDictionary<string,object>)' has some invalid arguments
What am I doing wrong???
Haacked
Contributor
6901 Points
412 Posts
Re: Html.Form and enctype = "multipart/form-data"
Aug 29, 2008 11:48 PM|LINK
Which version of MVC are you using?
Senior Program Manager, Microsoft
What wouldn’t you do for a Klondike bar?
levib
Star
7702 Points
1099 Posts
Microsoft
Re: Html.Form and enctype = "multipart/form-data"
Aug 29, 2008 11:54 PM|LINK
The extension method you're trying to call takes a dictionary as its last parameter, not an anonymous object.