ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.dotnettutorial.co.in/2022/05/using-database-bind-json-data-to-html-table-in-mvc.html |
| Last Crawled | 2026-04-06 23:25:29 (11 hours ago) |
| First Indexed | 2022-06-02 00:40:48 (3 years ago) |
| HTTP Status Code | 200 |
| Meta Title | [Using DataTable] Bind Json Data To Html Table Using Jquery In Mvc |
| Meta Description | In this tutorial, we will see how we can Bind JSON Data To Html Table Using Jquery In MVC. In this process |
| Meta Canonical | null |
| Boilerpipe Text | In this tutorial, we will see how we can
Bind JSON Data To Html Table Using JQuery In MVC.
In this process, we will use the Ajax Method to bind the data from the DataTable.
Add Controller.
Add a action.
Right Click on Action to add the views.
Add Model Student.cs
Create JsonResult Function to Call bind the data.
Call JsonResult from Ajax on Razor View.
On HomeController
using
System;
using
System.Collections.Generic;
using
System.Data;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
AjaxDataTable.Models;
namespace
AjaxDataTable.Controllers
{
public
class
HomeController
: Controller
{
public
ActionResult StudentList()
{
ViewBag.Title =
"Home Page"
;
return
View();
}
public
JsonResult GetJsonData()
{
DataTable dt =
new
DataTable();
dt.Columns.Add(
"ID"
,
typeof
(Int32));
dt.Columns.Add(
"Name"
,
typeof
(
string
));
dt.Columns.Add(
"Phone"
,
typeof
(
string
));
dt.Columns.Add(
"EmailID"
,
typeof
(
string
));
dt.Columns.Add(
"Address"
,
typeof
(
string
));
dt.Rows.Add(1,
"Jhon"
,
"1234567890"
,
"
[email protected]
"
,
"UK"
);
dt.Rows.Add(2,
"Liam"
,
"989898980"
,
"
[email protected]
"
,
"UK"
);
dt.Rows.Add(3,
"William"
,
"65656565656"
,
"
[email protected]
"
,
"UK"
);
dt.Rows.Add(4,
"James"
,
"9090786745"
,
"
[email protected]
"
,
"UK"
);
List<Student> model =
new
List<Student>();
if
(dt.Rows.Count > 0)
{
foreach
(DataRow row
in
dt.Rows)
{
model.Add(
new
Student
{
ID =
Convert.ToInt32(row[
"ID"
]),
Name =
Convert.ToString(row[
"Name"
]),
Phone =
Convert.ToString(row[
"Phone"
]),
EmailID = Convert.ToString(row[
"EmailID"
]),
Address =
Convert.ToString(row[
"Address"
])
});
}
}
return
Json(model);
}
}
}
On Student.cs Model
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
namespace
AjaxDataTable.Models
{
public
class
Student
{
public
int
ID {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
string
Phone {
get
;
set
; }
public
string
EmailID {
get
;
set
; }
public
string
Address
{
get
;
set
; }
}
}
On StudentList.cshtml
@{
ViewData[
"Title"
] =
"Bind json data to table using jquery in mvc –dotnettutorial.co.in"
;
}
<
script
src
="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></
script
>
<
script
>
$(document).ready(
function
() {
$.ajax({
type:
"POST"
,
url:
'
@
Url.Action(
"GetJsonData"
,
"Home"
)
'
,
data:
"[]"
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
success:
function
(data)
{
var
output = data.map(i =>
"<tr><td>"
+ i.ID +
"</td><td>"
+ i.Name +
"</td><td>"
+ i.Phone +
"</td><td>"
+ i.EmailID +
"</td><td>"
+ i.Address +
"</td></tr>"
);
$(
"#studentdata"
).html(output);
}
});
});
</
script
>
<
div
class
="text-center">
<
h1
>
Student List
</
h1
>
<
table
class
="table table-bordered">
<
tr
class
="table-head">
<
th
class
="text-center">
ID
</
th
>
<
th
class
="text-center">
Name
</
th
>
<
th
class
="text-center">
Phone
</
th
>
<
th
class
="text-center">
EmailID
</
th
>
<
th
class
="text-center">
Address
</
th
>
</
tr
>
<
tbody
id
="studentdata">
</
table
>
</
div
>
In this tutorial, we have learned how to bind Json Data To Html Table. If you have any doubt, feel free to comment below. |
| Markdown | ### Facebook SDK
[](https://www.dotnettutorial.co.in/)
- [Home](https://www.dotnettutorial.co.in/)
- [C\#](https://www.dotnettutorial.co.in/2022/05/{getMega}%20$label={c%20sharp}%20$type={msimple})
- [OOPS](https://www.dotnettutorial.co.in/2022/05/{getMega}%20$label={oops}%20$type={msimple})
- [JQuery](https://www.dotnettutorial.co.in/2022/05/{getMega}%20$label={JQuery}%20$type={msimple})
- [SQL](https://www.dotnettutorial.co.in/2022/05/{getMega}%20$label={SQL}%20$type={msimple})
- [More](https://www.dotnettutorial.co.in/)
- [\_Asp.Net](https://www.dotnettutorial.co.in/search/label/.net)
- [\_Registration Form](https://www.dotnettutorial.co.in/2019/03/registration-form-in-aspnet-with-store-procedure.html)
- [\_HTML](https://www.dotnettutorial.co.in/search/label/Html)
- [\_SQL Salary Related Q/A](https://www.dotnettutorial.co.in/search/label/Higest%20Salary)
[Home](https://www.dotnettutorial.co.in/)[Ajax](https://www.dotnettutorial.co.in/search/label/Ajax)
# \[Using DataTable\] Bind Json Data To Html Table Using Jquery In Mvc
bySanjay Yadav
\-
11:22 PM
0
In this tutorial, we will see how we can ***Bind JSON Data To Html Table Using JQuery In MVC.*** In this process, we will use the Ajax Method to bind the data from the DataTable.
[](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaw1oBlcAGVHi6K9gjCK_miK3yvghfrfFJdUWbjKTxbZ3qeftZ6XUo0-R7E9RwgRDfixWRFAiis6e1FJ0PrnutZjDxc23hpyhFwA25Hyne8Yps7U8JOkppEirgjLqbSc-D7AVQdFX5FeVO_BUGkXtWnpk_OW1Tld1UF_QIjTQkE8toF8s4u6YaejJOtw/s466/ajax_data_bind.PNG)
## **Steps to Bind Json Data To Html Table Using Jquery In Mvc**
1. Add Controller.
2. Add a action.
3. Right Click on Action to add the views.
4. Add Model Student.cs
5. Create JsonResult Function to Call bind the data.
6. Call JsonResult from Ajax on Razor View.
## **On HomeController**
```
```
```
usingSystem;usingSystem.Collections.Generic;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Mvc;usingAjaxDataTable.Models;namespaceAjaxDataTable.Controllers{public class HomeController: Controller{publicActionResult StudentList(){ViewBag.Title = "Home Page";returnView();}publicJsonResult GetJsonData(){DataTable dt = newDataTable();dt.Columns.Add("ID", typeof(Int32));dt.Columns.Add("Name", typeof(string));dt.Columns.Add("Phone", typeof(string));dt.Columns.Add("EmailID", typeof(string));dt.Columns.Add("Address", typeof(string));dt.Rows.Add(1, "Jhon", "1234567890", "[email protected]", "UK");dt.Rows.Add(2, "Liam", "989898980", "[email protected]", "UK");dt.Rows.Add(3, "William", "65656565656", "[email protected]", "UK");dt.Rows.Add(4, "James", "9090786745", "[email protected]", "UK");List<Student> model = newList<Student>();if(dt.Rows.Count > 0){foreach (DataRow row indt.Rows){model.Add(newStudent{ID = Convert.ToInt32(row["ID"]),Name = Convert.ToString(row["Name"]),Phone = Convert.ToString(row["Phone"]),EmailID = Convert.ToString(row["EmailID"]),Address = Convert.ToString(row["Address"])});}}returnJson(model);}}}
```
##
## **On Student.cs Model**
```
using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace AjaxDataTable.Models{public class Student{public int ID { get; set; }public string Name { get; set; }public string Phone { get; set; }public string EmailID { get; set; }public string Address { get; set; }}}
```
##
## **On StudentList.cshtml**
```
@{ViewData["Title"] = "Bind json data to table using jquery in mvc –dotnettutorial.co.in";}<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script>$(document).ready(function() {$.ajax({type: "POST",url: '@Url.Action("GetJsonData", "Home")',data: "[]",contentType: "application/json; charset=utf-8",dataType: "json",success: function(data){var output = data.map(i => "<tr><td>" + i.ID + "</td><td>" + i.Name + "</td><td>" + i.Phone + "</td><td>" + i.EmailID + "</td><td>" + i.Address + "</td></tr>");$("#studentdata").html(output);}});});</script>
<div class="text-center"><h1>Student List</h1><table class="table table-bordered"><tr class="table-head"><th class="text-center">ID</th><th class="text-center">Name</th><th class="text-center">Phone</th><th class="text-center">EmailID</th><th class="text-center">Address</th></tr><tbody id="studentdata"></table></div>
```
In this tutorial, we have learned how to bind Json Data To Html Table. If you have any doubt, feel free to comment below.
Tags: [Ajax](https://www.dotnettutorial.co.in/search/label/Ajax) [mvc](https://www.dotnettutorial.co.in/search/label/mvc)
- [Share on Facebook]("Facebook")
- [Share on Twitter]("Twitter")
### You might like
#### Post a Comment
[Post a Comment (0)]()
[Previous Post](https://www.dotnettutorial.co.in/2018/07/stored-procedure-to-insert-data-into-multiple-tables-in-sql-server.html) [Next Post](https://www.dotnettutorial.co.in/2018/04/what-is-the-use-of-static-class-in-c-dot-net-with-example.html)
### Follow Us
### Popular Posts
mvc
\-
10:33 PM
## [Authentication in ASP.NET MVC With Example](https://www.dotnettutorial.co.in/2025/07/authentication-in-aspnet-mvc-with-example.html)
## [Registration form in asp.net C\# with validation using SQL Server](https://www.dotnettutorial.co.in/2019/03/registration-form-in-aspnet-with-store-procedure.html)
## [Generate random password in asp.net using c\# and save in database](https://www.dotnettutorial.co.in/2018/07/how-to-generate-random-password-in-asp-net-and-save-in-databse.html)
### Search This Blog
### CATEGORIES
- [asp dot net](https://www.dotnettutorial.co.in/search/label/asp%20dot%20net)
- [SQL](https://www.dotnettutorial.co.in/search/label/SQL)
- [javascript](https://www.dotnettutorial.co.in/search/label/javascript)
- [JQuery](https://www.dotnettutorial.co.in/search/label/JQuery)
- [c sharp](https://www.dotnettutorial.co.in/search/label/c%20sharp)
- [.net](https://www.dotnettutorial.co.in/search/label/.net)
- [oops](https://www.dotnettutorial.co.in/search/label/oops)
- [mvc](https://www.dotnettutorial.co.in/search/label/mvc)
- [Ajax](https://www.dotnettutorial.co.in/search/label/Ajax)
- [Sql Keys](https://www.dotnettutorial.co.in/search/label/Sql%20Keys)
- [Higest Salary](https://www.dotnettutorial.co.in/search/label/Higest%20Salary)
- [ado dot net](https://www.dotnettutorial.co.in/search/label/ado%20dot%20net)
- [AngularJS](https://www.dotnettutorial.co.in/search/label/AngularJS)
- [Typescript](https://www.dotnettutorial.co.in/search/label/Typescript)
- [Diffrence b/w](https://www.dotnettutorial.co.in/search/label/Diffrence%20b%2Fw)
- [Html](https://www.dotnettutorial.co.in/search/label/Html)
- [Faq](https://www.dotnettutorial.co.in/search/label/Faq)
- [WildCard](https://www.dotnettutorial.co.in/search/label/WildCard)
- [general](https://www.dotnettutorial.co.in/search/label/general)
- [syntex](https://www.dotnettutorial.co.in/search/label/syntex)
### About Us
Find the Daily uses source code for .Net, Jquery, Javascript and SQL Server..
### Follow Us
### Popular Posts
## [Authentication in ASP.NET MVC With Example](https://www.dotnettutorial.co.in/2025/07/authentication-in-aspnet-mvc-with-example.html)
## [Registration form in asp.net C\# with validation using SQL Server](https://www.dotnettutorial.co.in/2019/03/registration-form-in-aspnet-with-store-procedure.html)
## [Generate random password in asp.net using c\# and save in database](https://www.dotnettutorial.co.in/2018/07/how-to-generate-random-password-in-asp-net-and-save-in-databse.html)
Design by - [Dotnettutorials](https://www.dotnettutorial.co.in/)
- [Home](https://www.dotnettutorial.co.in/)
- [Contact Us](https://www.dotnettutorial.co.in/p/contact-us.html)
- [Privacy Policy](https://www.dotnettutorial.co.in/p/privacy-policy.html)
- [SQL Course](https://www.dotnettutorial.co.in/p/microsoft-ql-free-course-online.html)
### Contact Form |
| Readable Markdown | In this tutorial, we will see how we can ***Bind JSON Data To Html Table Using JQuery In MVC.*** In this process, we will use the Ajax Method to bind the data from the DataTable.
[](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaw1oBlcAGVHi6K9gjCK_miK3yvghfrfFJdUWbjKTxbZ3qeftZ6XUo0-R7E9RwgRDfixWRFAiis6e1FJ0PrnutZjDxc23hpyhFwA25Hyne8Yps7U8JOkppEirgjLqbSc-D7AVQdFX5FeVO_BUGkXtWnpk_OW1Tld1UF_QIjTQkE8toF8s4u6YaejJOtw/s466/ajax_data_bind.PNG)
1. Add Controller.
2. Add a action.
3. Right Click on Action to add the views.
4. Add Model Student.cs
5. Create JsonResult Function to Call bind the data.
6. Call JsonResult from Ajax on Razor View.
## **On HomeController**
```
```
```
usingSystem;usingSystem.Collections.Generic;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Mvc;usingAjaxDataTable.Models;namespaceAjaxDataTable.Controllers{public class HomeController: Controller{publicActionResult StudentList(){ViewBag.Title = "Home Page";returnView();}publicJsonResult GetJsonData(){DataTable dt = newDataTable();dt.Columns.Add("ID", typeof(Int32));dt.Columns.Add("Name", typeof(string));dt.Columns.Add("Phone", typeof(string));dt.Columns.Add("EmailID", typeof(string));dt.Columns.Add("Address", typeof(string));dt.Rows.Add(1, "Jhon", "1234567890", "[email protected]", "UK");dt.Rows.Add(2, "Liam", "989898980", "[email protected]", "UK");dt.Rows.Add(3, "William", "65656565656", "[email protected]", "UK");dt.Rows.Add(4, "James", "9090786745", "[email protected]", "UK");List<Student> model = newList<Student>();if(dt.Rows.Count > 0){foreach (DataRow row indt.Rows){model.Add(newStudent{ID = Convert.ToInt32(row["ID"]),Name = Convert.ToString(row["Name"]),Phone = Convert.ToString(row["Phone"]),EmailID = Convert.ToString(row["EmailID"]),Address = Convert.ToString(row["Address"])});}}returnJson(model);}}}
```
## **On Student.cs Model**
```
using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace AjaxDataTable.Models{public class Student{public int ID { get; set; }public string Name { get; set; }public string Phone { get; set; }public string EmailID { get; set; }public string Address { get; set; }}}
```
## **On StudentList.cshtml**
```
@{ViewData["Title"] = "Bind json data to table using jquery in mvc –dotnettutorial.co.in";}<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script>$(document).ready(function() {$.ajax({type: "POST",url: '@Url.Action("GetJsonData", "Home")',data: "[]",contentType: "application/json; charset=utf-8",dataType: "json",success: function(data){var output = data.map(i => "<tr><td>" + i.ID + "</td><td>" + i.Name + "</td><td>" + i.Phone + "</td><td>" + i.EmailID + "</td><td>" + i.Address + "</td></tr>");$("#studentdata").html(output);}});});</script>
<div class="text-center"><h1>Student List</h1><table class="table table-bordered"><tr class="table-head"><th class="text-center">ID</th><th class="text-center">Name</th><th class="text-center">Phone</th><th class="text-center">EmailID</th><th class="text-center">Address</th></tr><tbody id="studentdata"></table></div>
```
In this tutorial, we have learned how to bind Json Data To Html Table. If you have any doubt, feel free to comment below. |
| Shard | 160 (laksa) |
| Root Hash | 13553251105045825560 |
| Unparsed URL | in,co,dotnettutorial!www,/2022/05/using-database-bind-json-data-to-html-table-in-mvc.html s443 |