This project is read-only.

Images in a master file

Topics: Themes
Jul 23, 2013 at 9:07 PM
Hello all,

Just found and installed blogengine today. So far it's great.

My questions is: I have created my site.master file in my custom theme and I have an include file for my header.ascx file called in the site.master. I have called some images in the header.ascx file but they are not displaying properly. Is there a tag that I need to add to the url of the image in-order for it to be displayed correctly?

Jul 23, 2013 at 10:24 PM
You can use something like this:
<img runat="server" src="<%=BlogEngine.Core.Utils.RelativeWebRoot %>images/image.png"/>
Jul 25, 2013 at 3:11 PM
Edited Jul 25, 2013 at 4:02 PM
Thanks for the suggestion rtur but this didn't work for me. I was able to get the image to display using an absolute url. I'm working locally so my url looks like this: http://localhost/BlogName/themes/ThemeName/img/image.jpg. But obviously I'd like to avoid this since it won't work once uploaded to the live server. All of the images that I'm referencing in my css seem to working and display properly it's just one logo image that I have in my template.

Any other ideas?

Jul 25, 2013 at 5:07 PM
Edited Jul 25, 2013 at 5:08 PM
Always works for me, but you can also try this. (look at the code example).
Jul 31, 2013 at 2:26 PM
Yeah, I'm not really sure what the issue is but I am surprised there is no real instruction on the website even describing your example above. Unless I just haven't stumbled upon it yet.

For the time being I'm just displaying the images using css.