finance_teacher
asked on
ASP.Net MVC 4 C# -- Details Paging (Previous/Next)
How can I add "Previous/Next" buttons to the below
Details.cshtml code so only "Classic" Genre
items can be viewed ?
-------------------------- ---------- ---------- --------
Steps
1. run MvcMusicStore APP
2. click on the "Classic" Genre
3. below \Views\Store\GenreMenu.csh tml displays
@model IEnumerable<MvcMusicStore. Models.Gen re>
<ul id="categories">
@foreach (var genre in Model)
{
<li>@Html.ActionLink(genre .Name,
"Browse", "Store",
new { Genre = genre.Name }, null)
</li>
}
</ul>
4. click on an item
5. below \Views\Store\Details.cshtm l displays
-------------------------- ---------- ---------- --------
@model MvcMusicStore.Models.Album
@{
ViewBag.Title = "Album - " + Model.Title;
}
<h2>@Model.Title</h2>
<p>
<img alt="@Model.Title" src="@Model.AlbumArtUrl" />
</p>
<div id="album-details">
<p>
<em>Genre:</em>
@Model.Genre.Name
</p>
<p>
<em>Artist:</em>
@Model.Artist.Name
</p>
<p>
<em>Price:</em>
@String.Format("{0:F}", Model.Price)
</p>
<p class="button">
@Html.ActionLink("Add to cart", "AddToCart",
"ShoppingCart", new { id = Model.AlbumId }, "")
</p>
</div>
-------------------------- ---------- ---------- --------
Something like the below, but want as easy as possible
** http://stackoverflow.com/questions/1522622/creating-a-detailsview-pager-in-asp-net-mvc
** http://stackoverflow.com/questions/9496837/go-to-next-record-from-asp-net-mvc-details-view
** http://stackoverflow.com/questions/13298605/filter-and-pagination-in-mvc-4
Details.cshtml code so only "Classic" Genre
items can be viewed ?
--------------------------
Steps
1. run MvcMusicStore APP
2. click on the "Classic" Genre
3. below \Views\Store\GenreMenu.csh
@model IEnumerable<MvcMusicStore.
<ul id="categories">
@foreach (var genre in Model)
{
<li>@Html.ActionLink(genre
"Browse", "Store",
new { Genre = genre.Name }, null)
</li>
}
</ul>
4. click on an item
5. below \Views\Store\Details.cshtm
--------------------------
@model MvcMusicStore.Models.Album
@{
ViewBag.Title = "Album - " + Model.Title;
}
<h2>@Model.Title</h2>
<p>
<img alt="@Model.Title" src="@Model.AlbumArtUrl" />
</p>
<div id="album-details">
<p>
<em>Genre:</em>
@Model.Genre.Name
</p>
<p>
<em>Artist:</em>
@Model.Artist.Name
</p>
<p>
<em>Price:</em>
@String.Format("{0:F}", Model.Price)
</p>
<p class="button">
@Html.ActionLink("Add to cart", "AddToCart",
"ShoppingCart", new { id = Model.AlbumId }, "")
</p>
</div>
--------------------------
Something like the below, but want as easy as possible
** http://stackoverflow.com/questions/1522622/creating-a-detailsview-pager-in-asp-net-mvc
** http://stackoverflow.com/questions/9496837/go-to-next-record-from-asp-net-mvc-details-view
** http://stackoverflow.com/questions/13298605/filter-and-pagination-in-mvc-4
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Do you have any other links ?
http://forums.asp.net/t/1707072.aspx/1
http://en.webdiyer.com/MvcPager