Disappearing Images

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
12/30/2011 12:24:04 PM
Gravatar
Total Posts 148

Disappearing Images

Hi:

I added an image to the layout.master file under the Data\Sites\1\Skins\[MyTheme] folder.  The first page of my site includes the image. However, if I add a new page, the image disappears. The space is there but no image. It just has that red rectangle where there should be an image.  This is not happening on the development server inside Visual Studio, just when I'm hosting inside IIS 7.5 on Windows Web Server 2008 R2.

12/30/2011 4:56:53 PM
Gravatar
Total Posts 355

Re: Disappearing Images

How are you mapping to the image?

1/3/2012 12:08:01 PM
Gravatar
Total Posts 148

Re: Disappearing Images

Hi:

Like this:

ImageUrl="~/Data/Sites/1/skins/[MyTheme]/[MyImages]/home_icon.bmp"

I have the same problem with all images, even my background image won't show up. I have cleared the cache many times to verify I have the current page.  This is only happening in IIS 7.5. In VS 2010, everything is fine.

I just took an existing skin and changed the image files to my liking.  I added the extra directory [MyImages] but other than that the directory is an exact copy of an existing skin with the image files changed.

1/3/2012 12:14:52 PM
Gravatar
Total Posts 18439

Re: Disappearing Images

Hi,

.bmp is not a valid image format for the web. It "might" work in IE but it will not work in other browsers and I doubt if IIS will even serve it because there is probably not a mime type mapped for .bmp in IIS.

Convert the image to .jpg or .png

Hope that helps,

Joe

1/3/2012 1:27:16 PM
Gravatar
Total Posts 355

Re: Disappearing Images

Also - just map to it as a normal image (ex:<img src="/Data/Sites/1/skins/[MyTheme]/[MyImages]/home_icon.png">), and you'll find that it works just fine.

1/3/2012 2:15:28 PM
Gravatar
Total Posts 18439

Re: Disappearing Images

We also have a built in control to make it easier to use images from beneath the skin folder in a way that is more portable so that if you copy the skin to a new site with a different site id or change the skin name it still works.

<portal:SkinFolderImage id="img1" runat="server" ImageFileName="MyImages/home_icon.png" />

assuming the folder where you have the image beneath your skin folder is named MyImages

1/3/2012 2:18:46 PM
Gravatar
Total Posts 355

Re: Disappearing Images

Joe - thanks for posting this; I remembered it (vaguely), but couldn't find an example quickly (too much multitasking today)!

1/3/2012 4:12:05 PM
Gravatar
Total Posts 148

Re: Disappearing Images

Hi

 

Using :

<portal:SkinFolderImageid="SkinFolderImage1"runat="server"ImageFileName="arrow.jpg"/>

still didn't work. Frown

I am adding a line such as this in the layout.Master in the Data\Sites\1\skins\[MySkin] folder:

<portal:SkinFolderImageid="SkinFolderImage1"runat="server"ImageFileName="arrow.jpg"/>

The image shows up on the first page but that's it. Cry

 

1/3/2012 4:18:34 PM
Gravatar
Total Posts 355

Re: Disappearing Images

Is the image in the same folder as the layout.master?

1/3/2012 4:32:27 PM
Gravatar
Total Posts 148

Re: Disappearing Images

Hi:

Yes.

 

1/3/2012 4:36:40 PM
Gravatar
Total Posts 148

Re: Disappearing Images

Hi:

I need to add that everything is working fine inside VS 2010. It's just when I make a request from IIS 7.5 on a server the images won't show up.

1/3/2012 4:37:56 PM
Gravatar
Total Posts 2253

Re: Disappearing Images

What are the urls for a page that is working and one that isn't working? If the site is not accessible via the internet that is fine. I just want to know what the full urls are because that could be part of the problem.

Thanks,
Joe D.

1/3/2012 5:42:18 PM
Gravatar
Total Posts 148

Re: Disappearing Images

Hi:

Joe, you warned me not to use mapping like http://servername/MyPage/Default.aspx.  I created a new site and DID NOT use the type of mapping you warned me against and the images are showing up now. 

You must sign in to post in the forums. This thread is closed to new posts.