Rendering Customer Avatar in View

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi guys,

I am trying to render user avatars in a partial view I am making. How the heck do I do this? I can't figure out how to get the picture service initialized so that I can use '.GetPictureUrl()'. Can someone please post the correct c# here (including the necessary "using" statements), pretty please?
7 years ago
DerekFoulk wrote:
Hi guys,

I am trying to render user avatars in a partial view I am making. How the heck do I do this? I can't figure out how to get the picture service initialized so that I can use '.GetPictureUrl()'. Can someone please post the correct c# here (including the necessary "using" statements), pretty please?



Try like bellow==>




@{
    var pictureService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Services.Media.IPictureService>();
    //now use like     pictureService.GetPictureUrl(yourPictureId,yourDesiredSize);

}

7 years ago
@sohel - You are the man! I didn't know that was how you used that... Thank you very much!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.