Iam working with Asp.net mvc3 Project.Here in my list view I want to creating paging
I tired alot i didn't get any solution please provide solution
my model class is
SelectSiteModel.cs
public class SelectSiteModel
{
//[Required]
//public string SiteID { get; set; }
[Required]
public string SiteName { get; set; }
[Required]
public string SiteAddress { get; set; }
[Required]
public string WorkOrderNo { get; set; }
public DataSet GetAllSiteDetails()
{
SqlConnection cn = new SqlConnection(@"Data Source=USHODAYA-PC1;Initial Catalog=VendorManagement;Integrated Security=True");
SqlCommand cmd = new SqlCommand("Select * From Site", cn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
return ds;
}
}
and my Cotroller code is
public ActionResult Index(SelectSiteModel selectSiteModel)
{
DataSet ds = selectSiteModel.GetAllSiteDetails();
ViewBag.SiteList = ds.Tables[0];
return View();
}
Index.cshtml is
SiteID | SiteName | Site Address | Site WOrkOrderNo | |
@Html.ActionLink("Edit", "UpdateSite", new { id = dr["SiteId"].ToString() }) @* @Html.ActionLink("Delete", "Delete", new { id = dr["SiteId"].ToString()})*@ | @dr["SiteId"].ToString() | @dr["SiteName"].ToString() | @dr["SiteAddress"].ToString() | @dr["WorkOrderNo"].ToString() |
Please give solution for this
Regards
NagaRaju

Jaganathan BantheswaranPosted Oct 9, 2013, 11:53 PM
Nice example is here