I use ASP.NET MVC 2 for my project.
I'm trying to edit my product information using next code:
[HttpGet]
public ActionResult Edit(int id)
{
IProduct product = productService.getProductById(id);
return View(product);
}
IProduct and other IEntities are instansing using IoC Castle Windsor. Page for Edit is succesfully loaded. In the top of my page I declared that page must Inherits="System.Web.Mvc.ViewPage〈DomainModel.Entities.IProduct〉. And it is. But when I'm trying to update my changes using next code:
[HttpPost]
public ActionResult Edit(IProduct product)
{
//Whatever i did here i always get the error prevents my any actions
}
then i'm getting the error 'Cannot create an instance of an interface.'
Can anybody clarify why? Sorry for probably bad English, and thanks for any answer.