2
Reply

iframe function working in firefox but not working in internet explorer

sam

sam

Sep 29 2010 2:06 AM
9.8k
Hi.
I have a page where it will store temporary data in gridview,before we send the values to database.The values in temporary table gridview will give a link to google,where it will search the word and display results in iframe.
This works fine in firefox,but not working in internet explorer.
Is there any ways to overcome this guys?

<body>
    <div>
    <table>

<tr> <td class="style1"> <asp:Label ID="Label1" runat="server" Text="Caller Info :"></asp:Label> </td> <td style="width: 100px"> <asp:TextBox ID="TxtName" runat="server" class="cls" onekeypress="" autocomplete="off" ToolTip="Press Enter key for new input"></asp:TextBox> </td> </tr> <tr> <td class="style1"> <asp:Label ID="Label2" runat="server" Text="Date :" Visible="False"></asp:Label> </td> <td style="width: 100px"> <asp:TextBox ID="TextBox3" runat="server" ReadOnly="True" Visible="False"></asp:TextBox>
</td> </tr> <tr> <td class="style1"> <asp:Label ID="Label3" runat="server" Text="Time :" ></asp:Label> </td> <td style="width: 100px"> <asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox> <script type="text/javascript"> function ShowTime() {
var dt = new Date();
document.getElementById("<%= TextBox2.ClientID %>").value = dt.toLocaleTimeString();
window.setTimeout("ShowTime()", 1000);
}
</script> </td> </tr> <tr> <td> <asp:Label ID="Label4" runat="server" Text="User :" Visible="False"></asp:Label> </td> <td style="width: 100px"> <asp:TextBox ID="TextBox1" runat="server" ReadOnly="True" Visible="False"></asp:TextBox> </td> </tr> <tr> <td> <asp:Label ID="Label5" runat="server" Text="IP :"></asp:Label> </td> <td style="width: 100px"> <asp:TextBox ID="TextBox4" runat="server" ReadOnly="True"></asp:TextBox> </td> </tr> </table>
<asp:Button ID="BtnAddToTable" runat="server" align="right" class="cls" Text="Add" OnClick="BtnAddToTable_Click" />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" > <Columns> <asp:TemplateField HeaderText="Caller Information"> <ItemTemplate> <a onclick='document.getElementById("<%=iframe1.ClientID%>").src = this.href; return false;' href='http://www.google.com/#q=<%#DataBinder.Eval(Container.DataItem,"name")%>'> <%#DataBinder.Eval(Container.DataItem, "name")%></a> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText=""> <ItemTemplate> <asp:Button ID="BtnDelete" runat="server" Text="Clear" OnClick="BtnDelete_Click" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <iframe runat="server" id="iframe1" src="" class="cls" style="z-index: 105; left: 225px; position: absolute; top: 109px; width: 875px; height: 455px;" frameborder="1" title="Google Search Display" ></iframe>
</div> <asp:Button ID="BtnSendToDatabase" runat="server" class="cls" Text="Save to database" OnClick="BtnSendToDatabase_Click" OnClientClick="return AddConfirmation()" />

</body>


Answers (2)