Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with master page and firefox

0 views
Skip to first unread message

mora...@gmail.com

unread,
Apr 27, 2008, 2:21:41 AM4/27/08
to
This code works properly in IE ,but fire fox doesn't show the image!!

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Master Page</title>
<style type="text/css">

</style>
</head>
<body style="margin:0;">

<form id="form1" runat="server">
<div>
<center>
<table style="width:100%; background-color:Black; height:75px;"
cellpadding="0px;" cellspacing="0px">
<tr>
<td >
<asp:Image ID="image1" runat="server" ImageUrl="~/Images/
Banner.jpg" AlternateText="banner"/>
</td>
</tr>
</table>
</center>
<asp:contentplaceholder id="ContentPlaceHolder1"
runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>

Joe Fawcett

unread,
Apr 27, 2008, 5:31:18 AM4/27/08
to

<mora...@gmail.com> wrote in message
news:218d7b6a-bafb-433c...@w74g2000hsh.googlegroups.com...

What does the actual HTML look like if you use view source in FireFox? Just
show the few lines with the image element if it's a large page.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Morad

unread,
Apr 27, 2008, 6:50:00 AM4/27/08
to
On Apr 27, 11:31 am, "Joe Fawcett" <joefawc...@newsgroup.nospam>
wrote:
> <morad...@gmail.com> wrote in message

Here is the body of the actual HTML:

<body style="margin:0;">

<form name="aspnetForm" method="post" action="default.aspx"
id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/
wEPDwULLTEwMDUyNjYzMjhkZDb/t/kquMagf1RBrd1IArHZAeT+" />
</div>

<div>
<center>
<table style="width:100%; background-color:Black; height:75px;"
cellpadding="0px" cellspacing="0px">
<tr>
<td >

<img id="ctl00_image1" src="Images/Banner.jpg" alt="banner"
style="border-width:0px;" />
</td>
</tr>
</table>

</center>

</div>
</form>
</body>

Joe Fawcett

unread,
Apr 27, 2008, 10:03:27 AM4/27/08
to
> Here is the body of the actual HTML:
>
> <body style="margin:0;">
>
> <form name="aspnetForm" method="post" action="default.aspx"
> id="aspnetForm">
> <div>
> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/
> wEPDwULLTEwMDUyNjYzMjhkZDb/t/kquMagf1RBrd1IArHZAeT+" />
> </div>
>
> <div>
> <center>
> <table style="width:100%; background-color:Black; height:75px;"
> cellpadding="0px" cellspacing="0px">
> <tr>
> <td >
> <img id="ctl00_image1" src="Images/Banner.jpg" alt="banner"
> style="border-width:0px;" />
> </td>
> </tr>
> </table>
>
> </center>
>
> </div>
> </form>
> </body>

Seems fine and works for me. Do you have some sort of banner blocking
add-in?
Is this on a public site where I can try it?

Morad

unread,
Apr 28, 2008, 12:41:52 AM4/28/08
to

I run the website from local host and I think that fire fox blocks
images from local host, but don't know how to solve this problem. do
you have any idea how to solve it?

Morad

unread,
Apr 28, 2008, 2:38:57 AM4/28/08
to
thanks Joe.

I solved the prblem

The problem was that firefox stored the images in the cache. sol i had
to clear the cache before loading the page, in order to view the
image.

I solved this problem by changing the image url randomly, so there
would be no image in the cache which had the same name.

I added this code to the page load event of the master page:


protected void Page_Load(object sender, EventArgs e)
{
Random rand = new Random();
int num = rand.Next();
Banner.ImageUrl = "~Images/Banner.jpg?" +num.ToString();
}


thank you for helping

0 new messages