Solution: How to insert images into SiteFinity using ASP.NET or HTML image tags
By Default SiteFinity does not allow you to use images using HTML or ASP.NET IMAGE TAGS:
Solution:
we use \App_Themes\Images
we use the CSS \App_Themes\OurCompanNameTemplate.css
What did not work:
\images\imagename.png
What did work:
<img src="../../App_Themes/Images/icon_CourseCategoryHeading.PNG" border=0 vspace=0>
Thanks,
Doug Lubey of Louisiana
Search engine tags:
img tag src
<img src source
img tag src image folder
<asp:image
ASP.NET MASTER PAGES
Hi Doug,
Could you please give us some more details about your issue? Where do you enter the image - in a content block inside a page or as ASP.NET markup in a .master page? You can't enter ASP.NET tags in a content block but you can use the insert image dialog that is part of the rich Html field used to edit the content block contents.
Regards,The problem occured.
Using imag tags (html or asp.net image tags) nside of a control. The control is ultimately used inisde of a virtual page inside site finity.
yes: Hard coding the URL (inlcuding the http; etc)
....worked fine.
But I was looking for relativity....
Hi Doug,
I believe what you've encountered is a "bug" that was introduced with Sitefinity 4 (Telerik will tell you it's a feature). The issue is that the images module uses the /images/ name it the path and as you've noticed in another post the SF URL rewriting is very intrusive and prevents you from using the /images/ folder yourself. There is a way to change the image module to use something different i.e. "/imagelib/" but if you've already got images uploaded it's a pain and you'd have to worry about compatibility with upgrades etc. The easiest solution is to change your current /images/ folder to something like /img/ and then your images should display just fine.
That would be correct; I will mark your answer as correct;
here is an example which works too:
<
asp:Image
ID
=
"Image2"
runat
=
"server"
ImageUrl
=
"~/ImagesDoug/slide4.png"
/>
This has been brought up quite a few times but I, still, really have to disagree that the way Sitefinity handles images is inconvenient. The website templates file structure shows how custom templates and themes should be constructed. If we follow it, the end result is a very organized and portable package.
/Sitefinity/WebsiteTemplates/AwesomeTemplateName/App_Themes/AwesomeThemeName/Images/logo.png