I am developing a learning project with ASP.NET MVC.I have a page that lists logged users's books and I want to display books in two formats like this
Normal List --> Display Book Thumbnail, Title,Page count,Author...
Detail List ---> Display only Book Title,Author,Page Count in HTML Table format
format
so I have two view pages Books.aspx,BookDetails.aspx. One for normal list,one for detail list but I have one controller action that returns books from database and can return results only to one page.
public ActionResult Index()
{
//get books from database
return View(bookList);
}
Do I have to include a parameter and check parameter to return list to different view or is there a better way to do this? How can I use same Controller action to display two views?