You must Sign In to post a response.
  • Category: ASP.Net MVC

    Data binding in CSHTML with paging

    Hello.
    I have one requirement in MVC5.
    I want to bind the data in table format.
    First of all, suggest the best way to bind it like, use table, grid view or anything else.
    I want 2 buttons below the table, Next and Previous.
    By default always bind 10 records and on click on Next and Previous, data will refresh.
    It means that, it requires database side paging.
    Please give me sample if anyone have the same.
  • #768174
    Please reply to above.

  • #768178
    Simply you need to fetch the data from database and bind it to grid, see below steps
    1. Open Visual Studio 2010, Go to the New Project - Visual C#, Web, then ASP.NET MVC Web Application and click OK.
    2. After Clicking OK, New ASP.NET MVC5 Project window will open and there you have to choose MVC and press OK.
    3. After Clicking OK, you will see something like the following image in your Solution Explorer. You need to look out for Model, Controller and View folders that are the main files in MVC, others are too but these are main files.
    4. Now add modal files, controller
    5. see below link for more details
    http://www.c-sharpcorner.com/uploadfile/009464/bind-grid-view-with-database-in-mvc-5-in-c-sharp/

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments