Advertisement
Guest User

Untitled

a guest
Jun 24th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.24 KB | None | 0 0
  1.  
  2.  
  3. @model Tuple<PagedList.IPagedList<MVCProject.Models.Item>,MVCProject.Models.Category>
  4. @using PagedList.Mvc;
  5.  
  6. @{
  7.     ViewBag.Title = "Index";
  8.    
  9. }
  10. <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
  11. <script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
  12. <script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
  13.  
  14.  
  15. <div>
  16.    
  17.    
  18. </div>
  19. <div class="content">
  20.     <div class="content_box">
  21.  
  22.         @{
  23.             if (User.IsInRole("admin"))
  24.             {
  25.  
  26.                 <p>
  27.                    @Html.ActionLink("Добавить категорию растений", "Create", "Categories")
  28.                    
  29.                 </p>
  30.             }
  31.         }
  32.      
  33.         <ul class="grid_2">
  34.             @foreach (var item in Model.Item1)
  35.             {
  36.  
  37.                 <li>
  38.                     <img href="@Url.Action("Details", "Items", new { id = item.Id })" src="@Url.Content(item.ImageFilePath)" height="350" width="350" class="img-responsive" alt="" />
  39.  
  40.                     <span class="btn5"><a class="price" href="@Url.Action("Details", "Items", new { id = item.Id })"> @Html.DisplayFor(modelItem => item.Price) руб. |  <img src="@Url.Content("~/Content/Images/cart.png")" height="26" width="26" class="img-responsive" alt="" style="margin: 0px 0px"> </a></span>
  41.                     <p>@Html.DisplayFor(modelItem => item.Name)</p>
  42.                     @{
  43.                 if (User.IsInRole("admin"))
  44.                 {
  45.  
  46.                     <p>
  47.                         @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
  48.                         @Html.ActionLink("Details", "Details", new { id = item.Id }) |
  49.                         @Html.ActionLink("Delete", "Delete", new { id = item.Id })
  50.                     </p>
  51.                 }
  52.                     }
  53.                 </li>
  54.  
  55.  
  56.  
  57.             }
  58.  
  59.             <div class="clearfix"> </div>
  60.         </ul>
  61.  
  62.         Страница @(Model.Item1.PageCount < Model.Item1.PageNumber ? 0 : Model.Item1.PageNumber) из @Model.Item1.PageCount
  63.  
  64.         @Html.PagedListPager(Model.Item1, page => Url.Action("Index", new { page }))
  65.  
  66.     </div>
  67.  
  68. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement