.NET to Javascript compiler

C# code   Html page   Start
public class IFrameApp : HtmlGlobal
{
    HtmlIFrame frame;
    IDisposable disposable;

    public static void Start()
    {
        new IFrameApp();
    }

    IFrameApp()
    {
        frame = (HtmlIFrame)document.GetElementById("iframe").CloneNode(true);
        frame = (HtmlIFrame)document.Body.AppendChild(frame);
        disposable = frame.AdviseLoaded(iframe_Preloaded);
    }

    void iframe_Preloaded(HtmlEvent e)
    {
        disposable.Dispose();
        var html = "<form action='IFrame.html' method='get' name='form1' id='form1'><textarea>data</textarea></form>";
        HtmlDocument doc = frame.ContentWindow.Document;
        doc.Body.InnerHtml = html;
        frame.AdviseLoaded(iframe_Loaded);
        HtmlForm form = (HtmlForm)doc.GetElementById("form1");
        form.Submit();
    }

    void iframe_Loaded(HtmlEvent e)
    {
        document.GetElementById("data").InnerHtml = frame.ContentWindow.Document.GetElementById("data").InnerHtml;
    }
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
    <meta content="x-ua-compatible" http-equiv="IE=11;IE=10;IE=9;IE=8;IE=7" />
	<title>IFrame.html: IFrame event handling</title>
	<script type="text/javascript" language="javascript" src="js/IFrame.js"></script>
</head>
<body onload="javascript:StartScript()">
	IFrame.html: IFrame event handling
  <table cellpadding="2" cellspacing="0">
    <tr>
      <th>
        IFrame data
      </th>
      <td id="data">
        loading ...
      </td>
    </tr>
  </table>
  <iframe id="iframe" style="display:none" src="data/empty.html"></iframe>
</body>
</html>
© 2009 JScriptSuite. All rights reserved.