Hi everybody
I am currently experiencing an error while writing a new section on the homepage, when I delete the temporary files in the Temp directory, the title is displayed but when I stop and start website on iis, the title is not displayed. Or I also add an attribute for ProductSummaryModel ex Title and delete all file in the folder Temp ASP.Net website run fine but when in debug in visual studio but title not display. Can someone help me? Sorry my bad english.Thanks
Code in controller
//[ChildActionOnly] public ActionResult HomepageProductsByCategoryId(int? productThumbPictureSize, int categoryId, string title) { var products = _productService.GetAllProductsDisplayedOnHomePageByCategory(categoryId); // ACL and store mapping products = products.Where(p => _aclService.Authorize(p) && _storeMappingService.Authorize(p)).ToList(); var viewMode = _catalogSettings.UseSmallProductBoxOnHomePage ? ProductSummaryViewMode.Mini : ProductSummaryViewMode.Grid; var settings = _helper.GetBestFitProductSummaryMappingSettings(viewMode, x => { x.ThumbnailSize = productThumbPictureSize; }); var model = _helper.MapProductSummaryModel(products, settings); model.GridColumnSpan = GridColumnSpan.Max6Cols; model.Title = title; ViewBag.Title = title; return PartialView(model); }
Code in view
@model ProductSummaryModel @using SmartStore.Web.Models.Catalog; @{ if (Model.PagedList.TotalCount == 0) { return; } var Title = ViewBag.Title; //Model.Title; } <div class="product-grid product-grid-home-page block"> <div class="heading heading-center"> <h3 class="heading-title fs-h1">@Title</h3> </div> <div class="block-body pt-3 artlist-no-separators"> @{ Html.RenderPartial("Product.List", Model); } </div> </div>
Code in Index.cshtml
Html.RenderAction("HomepageProductsByCategoryId", "Catalog", new { categoryId =1, title="Hot Promotion"});