Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have add a image field in blog. when i access blog list getting image successfully. But after some time it shows error.

Nop.Web.Models.Media.PictureModel Nop.Web.Models.Blogs.BlogPostModel.get_Picture()

My code is

C#
int? productThumbPictureSize = null;
           int pictureSize = productThumbPictureSize.HasValue ? productThumbPictureSize.Value : _mediaSettings.ProductThumbPictureSize;

           if (blogPost.Picture != null)
           {
               var picture = _pictureService.GetPictureById(blogPost.Picture.Id);


               PictureModel pictureModel = new PictureModel();

               pictureModel.ImageUrl = _pictureService.GetPictureUrl(picture, pictureSize);
               pictureModel.FullSizeImageUrl = _pictureService.GetPictureUrl(picture);
               model.PictureModel = pictureModel;
           }


What I have tried:

I am trying to fetch image to show in blog list
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900