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
Luis sa
NA
10
6k
How to display Images in grid using Asp.net MVC
Jul 29 2016 4:24 AM
Hello,
I need some help in displaying Images in grid style using Asp.net MVC razor.
Here's what i have tried:-
-- Controller--
public ActionResult Index()
{
return View(db.Img_data.ToList());
}
--Razor View--
@using firstmvc.Models
@model IEnumerable<firstmvc.Models.Img_data>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/Adminmaster.cshtml";
}
<div>
<table class="table table-responsive">
@foreach (var item in Model)
{
<tr>
<td>
<img id="@item.Img_id" src="@Url.Content(@item.Img_data1)" data-zoom-image="@Url.Content(@item.Img_data1)" style="width:450px;height:300px" />
</td>
</tr>
}
</table>
</div>
And the result of the code in browser is :- http://prntscr.com/byyv9b
How i want to display the image is :-http://prntscr.com/byyvl5
Cheers
Reply
Answers (
3
)
master page and jquery
how to convert json data with multiple arrays to list in c#