ASP.NET MVC3 - receiving the "No overload for method 'BeginForm' takes 6 arguments" error message
My controller has two following methods...
public FileResult GetImage(int id)
{
// something
}
public FileResult GetImageTwo(int id)
{
// something
}
Create.cshtml as the following code...
@using (Html.BeginForm("Create", "ProductCategory", "GetImage",
"GetImageTwo", FormMethod.Post, new { enctype = "multipart/form-data"
}))
Update
So the answer is it can't be开发者_如何学JAVA done like this.
You need to specify which controller action you are going to post to and use the proper overload:
action controller method htmlAttributes
↓ ↓ ↓ ↓
@using (Html.BeginForm("GetImage", "ProductCategory", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
//somecode
}
That has nothing to do with routes. Error is simple, you are calling Html.BeginForm
overload that does not exists. In other words, there's no method like Html.BeginForm
which would take 6 arguments. If you update your question to show what are you trying to achieve, maybe stack could help you
精彩评论