I Have two method and distinct by http verb:
public class ProductImageController : Controller
{
[HttpGet]
public ViewResult Create(int productId)
{
return View(productId);
}
[HttpPost]
public ViewResult Create(int productId)
{
}
}
but Get Error:
already defines a member called 'Create' with the same parameter types
You can't have multiple methods with the same signature within the same scope like that i.e. same return type and parameter type.
EDIT- Looks like you need to use this: Related question
public class ProductImageController : Controller
{
[HttpGet]
public ViewResult Create(int productId)
{
return View(productId);
}
[HttpPost]
[ActionName("Create")]
public ViewResult CreatePost(int productId)
{
//return a View() somewhere in here
}
}