Accessing Theme images from codebehind

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 yıl önce
I know you can get refer to images in the NopCommerceStore/images directory using

URL = Page.ResolveUrl("~/images/IMAGENAME.jpg")

but how can I refer to images inside the NopCommerceStore/App_Themes/THEME/images directory from the code behind?

Thanks,
Steve.
13 yıl önce
try



URL = Page.ResolveUrl("~/App_themes/YOURTHEME/images/IMAGENAME.jpg")
13 yıl önce
Only problem with that is that if you change the theme, you have to change the code as well.  I was hoping there was something already built in to get the theme's path.

I guess I could use the Page.Theme property to build the string for ResolveUrl, but I did some rethinking and decided to rework my code to make it use CSS to assign the image as a background.

Thanks for your input.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.