How to write in IFrame

How to write in IFrame

HTMl Code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="writeinIFrame.aspx.cs" Inherits="myworks_iframeload" %>

<!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 id="Head1" runat="server">
    <title>Untitled Page</title>

    <script type="text/javascript">
        var iframedoc;
        function onLoad() {
            var iframe = document.createElement("iframe");
            document.getElementById("frame").appendChild(iframe);
            if (document.all) {
              iframedoc = iframe.contentWindow.document;
            } else {
              iframedoc = iframe.contentDocument;
            }
            iframedoc.writeln("<body></body>");
            iframedoc.body.innerHTML = "<b>Inline Frame</b>";  // *1
        }
        window.onload = function(){
         onLoad();
         }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="Div1">
        </div>
    </div>
    </form>
</body>
</html>

No  Responses to "How to write in IFrame"

Leave a Reply