Spitting out a Index view using parameters
- by George
Hello guys. I'm using ASP.MVC and trying to learn...
I have the following controller
// get all authors
public ActionResult Index()
{
var autores = autorRepository.FindAllAutores();
return View("Index", autores);
}
// get authors by type
public ActionResult Index(int id)
{
var autores = autorRepository.FindAllAutoresPorTipo(id);
return View("Index", autores);
}
If i try http://server/Autor/1 I get a 404 error. Why is that?
I even tried to create a specific method ListByType(int id) and the correspondent view, but that does not work too (URL: http://server/Autor/ListByType/1)
Any ideas?
Thanks in advanced
EDIT Oh, the http://server/Autor works just fine. The method without parameters is spitting out my view correctly.