In this article I will show you how to bind GridView using MVC3 C# using Razor.
Here I haven’t used any database, we manually feed that data into our Controller, so it’s a kind of binding gridview without any database. Step 1: Open Visual Studio 2010, go to the New Project, then Visual C#. After that click Web, select ASP.NET MVC3 Web Application and click OK. Step 2: After clicking OK, new ASP.NET MVC3 Project window will open, there you have you choose Internet Application and in View engine dropdown chose Razor. Step 3: After clicking OK, you will see something like the following image in 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. In Model Step 4: Right Click on Models, then Add New Item and Add a Class File [Class.cs] Name it Student.cs. Write the following code in Student.cs file. Student.cs
ASP.NET GridView Control Pocket Guide