Skip to main content
Inspiring
June 8, 2007
Question

Only Safari won't show home page image

  • June 8, 2007
  • 3 replies
  • 639 views
Helo

Having problems with home page image showing in only Safari ( www.truthandlife.info ). May be a css problem, but I don't know...

Originally, we had to alter the drop down menu becasue it wouldn't work on Safari, so a friend fixed that but that fix took away the main image - he writes:

"I found some other information that suggested setting the ClientTarget attribute to “uplevel” when you detect the Safari or Opera browsers.

I went ahead and implemented that by creating a base class called BasePage (in the App_Code folder) and made every page load derive from it using the “Inherits” parameter. This seemed to solve the problem on Safari (I don’t have Opera) without affecting IE7. Note that all new pages you create need to have the Inherits=”BasePage” tag set in their <Page> element.

So all is good in that the submenus pop up as we would expect…but there is a problem with the graphic on the default page. The main image doesn’t load on the Safari browser unless I remove that ClientTarget=”uplevel” statement. If I remove it, then the menus don’t work."
===============

So does anyone know what might be the problem and/or fix?

Thanks

KB
This topic has been closed for replies.

3 replies

CamEdAuthor
Inspiring
June 8, 2007
Still trying of course - so

I redid that alternate masthead for ie5.5 and updated the link - yes, now the ALTERNATE banner shows but NOT the image I need, which DOES still show in other browsers. Only in Safari does the alternate masthead now show, but not the main masthead needed.

Below is the code that directs the alternate image for ie 5.5 but why would this affect Safari?

=============
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class DefaultPage : BasePage
{
protected void Page_LoadComplete(object sender, EventArgs e)
{
if (!IsCallback)
{
// IE 5.5 isn't able to render the dynamic menu items correctly if
// the size of the header image is too large. To work around this problem,
// IE 5.5 gets a different header image than the other browsers.
if (Request.Browser.Id == "ie55")
{
mastheadImg.ImageUrl = String.Format("~/Images/homepage/masthead9.jpg", Page.Theme != null ? Page.Theme : Page.StyleSheetTheme);
mastheadImg.Height = 206;
litHeaderHeight.Text = "206px";
}
}
}
}

===============

Coupled with the BASE page code in my previous post, maybe there's a fix in one of these?

Any thoughts?

CamEdAuthor
Inspiring
June 8, 2007
Well if you meant this one -

<img id="ctl00_mastheadPh_mastheadImg" src="App_Themes/TruthAndLife/Images/homepage/masthead_ie55.jpg" alt="" style="height:206px;width:760px;border-width:0px;" />

I just now changed it but this image is only an ALTERNATE for IE 5.5, not the real main image....here is the code that seems to cause the problem in Safari, while fixing the menu flyout problem.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for BasePage
/// </summary>
public class BasePage : Page
{
public BasePage()
{

}

protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);

if (this.Request.ServerVariables["http_user_agent"].ToLower().Contains("safari"))
{
Page.ClientTarget = "uplevel";
}
}

}
Inspiring
June 8, 2007
iwics2 wrote:

> Helo
>
> Having problems with home page image showing in only Safari (
> www.truthandlife.info ). May be a css problem, but I don't know...


"Homepage" != "homepage"
Mick

>
> Originally, we had to alter the drop down menu becasue it wouldn't work on
> Safari, so a friend fixed that but that fix took away the main image - he
> writes:
>
> "I found some other information that suggested setting the ClientTarget
> attribute to ?uplevel? when you detect the Safari or Opera browsers.
>
> I went ahead and implemented that by creating a base class called BasePage (in
> the App_Code folder) and made every page load derive from it using the
> ?Inherits? parameter. This seemed to solve the problem on Safari (I don?t have
> Opera) without affecting IE7. Note that all new pages you create need to have
> the Inherits=?BasePage? tag set in their <Page> element.
>
> So all is good in that the submenus pop up as we would expect?but there is a
> problem with the graphic on the default page. The main image doesn?t load on
> the Safari browser unless I remove that ClientTarget=?uplevel? statement. If I
> remove it, then the menus don?t work."
> ===============
>
> So does anyone know what might be the problem and/or fix?
>
> Thanks
>
> KB
>
CamEdAuthor
Inspiring
June 8, 2007
Thanks for reply - so where, which file has the Homepage when it should be hompage?

Thanks

KB