---
title: "How to Parsing A JSON File With C# mvc."  
description: "How to Parsing A JSON File With C# mvc."  
author: "Anonymous User"  
published: 2016-01-24  
updated: 2016-01-24  
canonical: https://www.mindstick.com/forum/33918/how-to-parsing-a-json-file-with-c-sharp-mvc  
category: "asp.net mvc"  
tags: ["asp.net", "asp.net mvc", "mvc"]  
reading_time: 2 minutes  

---

# How to Parsing A JSON File With C# mvc.

I want to use [Parsing](https://www.mindstick.com/interview/1700/what-are-the-standard-ways-of-parsing-xml-document) A [JSON File](https://www.mindstick.com/forum/23303/how-to-create-json-file) With C# Mvc. How to do this please help me.

## Replies

### Reply by Anonymous User

```
 @model IEnumerable<ForumMVC.Models.Customer>      <!DOCTYPE html>      <html>          <head>              <meta name="viewport" content="width=device-width" />              <title>Index</title>          </head>          <body>              <p></p>              <table class="table">                  <tr>                      <th>                            @Html.DisplayNameFor(model => model.FirstName)                        </th>                      <th>                            @Html.DisplayNameFor(model => model.LastName)                        </th>                      <th>                            @Html.DisplayNameFor(model => model.EmailId)                        </th>                      <th></th>                  </tr>                        @foreach (var item in Model) {                          <tr>                          <td>                                @Html.DisplayFor(modelItem => item.FirstName)                            </td>                          <td>                                @Html.DisplayFor(modelItem => item.LastName)                            </td>                          <td>                                @Html.DisplayFor(modelItem => item.EmailId)                            </td>                      </tr>                  }                </table>          </body>      </html> 
```

```
using System;using System.Collections.Generic;using System.Linq;using System.Linq.Expressions;using System.Web;namespace ForumMVC.Models{    public class Customer    {        public int CustomerId        {            get;            set;        }        public string FirstName        {            get;            set;        }        public string LastName        {            get;            set;        }        public string EmailId        {            get;            set;        }    }}
```

```
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using ForumMVC;using System.Data.Entity;using ForumMVC.Models;using System.Web.Script.Serialization;namespace ForumMVC.Controllers{    public class HomeController : Controller    {                public ActionResult Index()        {                        string file = Server.MapPath("~/App_Data/Customer.json");                    string Json = System.IO.File.ReadAllText(file);            JavaScriptSerializer ser = new JavaScriptSerializer();            var  list = ser.Deserialize<List<Customer>>(Json);            return View(list);                     }    }}
```

```
[  {      "CustomerId": 1,      "FirstName": "sudhesh",      "LastName": "Patel",      "EmailId": "sudhesh@gmail.com"  },  {      "CustomerId": 1,      "FirstName": "suresh",      "LastName": "Patel",      "EmailId": "suresh@gmail.com"  },  {      "CustomerId": 1,      "FirstName": "Shiv Shingh",      "LastName": "Patel",      "EmailId": "shiv@gmail.com"  },  {      "CustomerId": 1,      "FirstName": "manoj",      "LastName": "Patel",      "EmailId": "manoj@gmail.com"  },  {      "CustomerId": 1,      "FirstName": "mayank",      "LastName": "Patel",      "EmailId": "manoj@gmail.com"  },  {      "CustomerId": 1,      "FirstName": "Mohit",      "LastName": "Patel",      "EmailId": "mohit@yahoo.com"  }]
```

![How to Parsing A JSON File With C# mvc.](https://www.mindstick.com/mindstickforums/43f2f8c9-c280-4632-8092-6b2d412fc72a/images/4e144cce-2b21-4a81-ad6f-0620dc8b13b1.png)


---

Original Source: https://www.mindstick.com/forum/33918/how-to-parsing-a-json-file-with-c-sharp-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
