TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vadivelu S
NA
16
618
how to load image in dynamic table using ajax success data
Dec 3 2016 1:04 AM
Html
<table id="HigPurchtbltabl" class="table table-striped dataTable no-footer">
<thead>
<tr>
<th>Table No</th>
</tr>
</thead>
<tbody></tbody>
</table>
Sctipt
<script type="text/javascript">
function getTablelist() {
debugger
$.ajax({
url: '../File/GetTableList',
type: 'POST',
dataType:"JSON",
success: function (data) {
debugger;
alert(data[0].FileName);
var HigPursdTrHTML = '';
var sno = 0;
$.each(data, function (i, item) {
HigPursdTrHTML += '<tr><td><img src ="' + data[i] + '.png"></td><tr>';
});
$("#HigPurchtbltabl").append(HigPursdTrHTML);
},
error: function (data) {
debugger;
alert("error")
}
});
}
</script>
Controller
[HttpPost]
public ActionResult GetTableList()
{
var fileToRetrieve = db.Files.ToList();
return Json(fileToRetrieve);
}
Reply
Answers (
1
)
how to insert the values inserted in dynamic rows in a table
How to create POS application in ASP.NET MVC