Hi everyone, how are you doing!
I'm just started learning MVC 2. I went through the music store example (though I don't 100% get everything). Now I want to add some functions to the page to learn more. I added paging, and now I want to add search combo boxes (drop down lists). Basically, in the album list screen, I want to add 1 drop down list of genre. If user select 1 genre then click Search, the page should show all album of that genre only.
My problem is I don't know how to get the selected value of this drop down list. The approach I am using now is to get the selected value, then put it as parameter and redirect to Index (/StoreManager/Index?searchGerneId=x). I searched through many posts but couldn't find a solution that works for me. It is probably because I don't really get MVC yet and still try to do things the code-behind way. So please help me :) My code for Index in Controller is below
public ActionResult Index(int pageNumber = 1, int searchGenreId = -1)
var albums = from album in storeDB.Albums
join genre in storeDB.Genres on album.GenreId equals genre.GenreId
join artist in storeDB.Artists on album.ArtistId equals artist.ArtistId
View Complete Post