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
Guest User
Tech Writer
103
13.3k
Set Card Using foreach.
May 14 2021 10:05 AM
How to display data using card with foreach.Please check this link
https://getbootstrap.com/docs/4.1/components/card/
and this is my code
<div class="container">
<div class="row">
@foreach (var blogPost in Model.Items)
{
<div class="col-md-4">
<div class="list-wrapper">
<div class="card shadow-sm border-light">
<a href="@blogPost.FullPath">
@if (blogPost.ThumbnailImageAsset != null)
{
<img src="~/Images/businessman-concept-illustration_114360-1246.jpg" />}
else
{
<img src="~/Images/businessman-concept-illustration_114360-1246.jpg" />
}
</a>
<div class="card-body">
<p class="card-title"><h>@blogPost.Title</h></p>
<p class="card-text">@blogPost.ShortDescription</p>
<a href="@blogPost.FullPath" class="read-more">Read More</a>
</div>
</div>
</div>
</div>
}
</div>
</div>
Reply
Answers (
2
)
How to create multiple data channels in a SampleDataSeries?
Consuming webservice in dot net API