We help IT Professionals succeed at work.
Get Started

Iframe not loaded with other browser than IE

Last Modified: 2012-05-11
I have an iframe in a web site that is not loaded when I try to view it in other browser than IE (IE works correctly).
The src attribute is set dinamically in the code behind.
The iframe is contained in an ascx page.

The web site is developped in ASP.NET/C# 1.1

Here is the HTML code:
<table id="Table1" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
      <TD vAlign="top" align="right" width="15%"></TD>
      <TD style="WIDTH: 880px" vAlign="top" align="left">
         <asp:label id="SketchNoDelete" runat="server" Visible="False" ForeColor="Red">You can't delete sketches that were previously saved.</asp:label></TD>
      <TD vAlign="top" align="right" width="20%"></TD>
      <td vAlign="top" align="right" width="15%"><asp:label id="SketchesLabel" runat="server">Sketches:</asp:label></td>
      <td style="WIDTH: 880px" vAlign="top" align="left">
         <P><INPUT id="sketchFileName" style="WIDTH: 440px; HEIGHT: 22px" type="file" size="54" runat="server">&nbsp;
            <asp:button id="Upload" runat="server" Text="Upload"></asp:button>&nbsp;
            <asp:button id="Draw" runat="server" Text="Draw"></asp:button><BR>
            <asp:label id="MaxFileSizeNote" runat="server">A maximum of 5Mb is allowed for each file.</asp:label><asp:label id="SketchError" runat="server" ForeColor="Red" Visible="False">The sketch was not recognized as a valid image.</asp:label><asp:label id="SketchTooBig" runat="server" ForeColor="Red" Visible="False">The file was too big.</asp:label><asp:label id="SketchNotFound" runat="server" ForeColor="Red" Visible="False">Unable to locate the request address on the map.</asp:label></P>
      <td vAlign="top" align="right" width="20%">
         <DIV style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; OVERFLOW: auto; BORDER-LEFT: black 1px solid; WIDTH: 266px; BORDER-BOTTOM: black 1px solid; HEIGHT: 100px"
            align="left"><asp:checkboxlist id="SketchList" runat="server" Width="160px"></asp:checkboxlist></DIV>
         <asp:button id="Delete" runat="server" Text="Delete"></asp:button></td>
      <TD colSpan="3"></TD>
		<TD colspan="3" align="center">
			<iframe id="kMapFrame" style="DISPLAY: none" name="kMapFrame" frameBorder="1" runat="server"
			width="830px" height="630px">
		<td colspan="2" align="right">
			<asp:Button id="getImageButton" runat="server" Text="Get image" Visible="False"></asp:Button>
		<TD colSpan="3"></TD>
      <td align="right" colSpan="3">&nbsp;
         <asp:button id="Save" runat="server" Text="Save"></asp:button><asp:button id="Cancel" runat="server" Text="Cancel"></asp:button></td>

Open in new window

Code behind:
// Set the map viewer url
                  string src = System.Configuration.ConfigurationSettings.AppSettings["MapGuideViewerAddress"];

                  // Set the sketch file name
                  DateTime dtNow = DateTime.Now;
                  string sketchName =  SessionHelper.CurrentTicket + "_" ;
                  sketchName += dtNow.ToString("dd_MM_yyyy_HH_mm_ff");

                  SketchFileName = sketchName + ".jpg";

                  // Add the url LatLong parameters
                  src += Regex.Replace("?lat=" + ptLatLong.Y.ToString() + "&lon=" + ptLatLong.X.ToString(),",",".");

                  // Add the url language parameter
                  src += "&lang=fr" ;

                  getImageButton.Visible = true;

                  // Display the PHP iFrame
                  kMapFrame.Style.Add("display", "");
                  kMapFrame.Attributes.Add("width", "830");
                  kMapFrame.Attributes.Add("height", "630");
                  kMapFrame.Attributes["src"] =  src;

Open in new window

Watch Question
Fixer of Problems
Most Valuable Expert 2014
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE