I am Creating OnlineSharee Website.I have Created ThumbnailImage, I want to Display In Div tag ProductImage,ProductName and ProductPrice from Database in MVC Asp.net.How can I do it.
Please send me sample code.
Regards
Bvenkat Jeewesh
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mike JonsonPosted Jul 14, 2012, 5:46 PM
@model SportStore.WebUI.Models.productListViewModel
@{
ViewBag.Title = "Products";
}
@foreach (var p in Model.Products)
{
Html.RenderPartial("ProductSummary", p);
}
@Html.PageLinks(Model.PagingInfo, x => Url.Action("List",
new { page = x, category=Model.CurrentCatregory }))
Its Partitial view product summary:
@model SportStore.Domain.Entities.Product
@Model.Name
@Model.Description
@using(Html.BeginForm("AddToCart", "Cart"))
{
@Html.HiddenFor(x => x.ProductID);
@Html.Hidden("returnUrl", Request.Url.PathAndQuery);
}
@Model.Price.ToString("c")