troubleshooting Question

Iframe not loaded with other browser than IE

Avatar of TelDig
TelDigFlag for Canada asked on
Web Languages and StandardsASP.NETHTML
6 Comments1 Solution591 ViewsLast Modified:
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

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros