Click here to Skip to main content
11,924,995 members (52,052 online)
Rate this:
Please Sign up or sign in to vote.
See more: MVC Razor
Hi All ,

I want to create List View control as we can see here :*[^]

or In this site[^]

In MVC- 4 Razor technology.

Please help me.


Posted 11-Apr-13 6:16am
Sandeep Mewara 11-Apr-13 12:50pm
Tried anything so far?
kapilonkar 12-Apr-13 2:44am
Hi Sandeep ,

Thanks for reply

No I am bit New to mvc , I have searched for using ListView in MVC but yet haven't got code snippet matching to my requirement using MVC razor.
please help me if you have an idea of how to do it.
Thanks anyways :)
Member 9802658 9-May-13 7:07am
my simple solution to paging in mvc4


1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

@model IEnumerable

ViewBag.Title = "Index2";
Layout = "~/Views/Shared/_Layout.cshtml";
ViewBag.maxPage = (ViewBag.recordsCount % OrganizationManagement.Common.Constants.rowsPerPage == 0) ? (ViewBag.recordsCount / OrganizationManagement.Common.Constants.rowsPerPage) : ((ViewBag.recordsCount / OrganizationManagement.Common.Constants.rowsPerPage) + 1);

<script src="~/Scripts/jquery.jqpagination.min.js"></script>
<link href="~/Content/jqpagination.css" rel="stylesheet" />

<script type="text/javascript">
$(document).ready(function () {

link_string: '~/Index2/?page={page_number}',
max_page: @ViewBag.maxPage,
paged: function (page) {
url: '@Url.Action("/Index2")',
type: "GET",
data: {currentPage:page},
success: function (result) {
var $response = $(result);

//Query the jQuery object for the values
var tableValue = $response.find('#StatusIndex').html();





@Html.ActionLink("Create New", "Create")

@using (Html.BeginForm("Index2", "Employee"))


<input type="submit" value="Search" />


@foreach (var item in Model) {

@Html.DisplayNameFor(model => model.EmployeeName)

@Html.DisplayNameFor(model => model.LocationName)

@Html.DisplayNameFor(model => model.DepartmentName)

@Html.DisplayNameFor(model => model.DOJ)
@Html.DisplayFor(modelItem => item.EmployeeName)
@Html.DisplayFor(modelItem => item.LocationName)
@Html.DisplayFor(modelItem => item.DepartmentName)
@Html.DisplayFor(modelItem => item.DOJ)
@Html.ActionLink("Edit", "Create", new { id=item.Id }) |
@Html.ActionLink("Details", "Details", new { id=item.Id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.Id })


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151125.3 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100