.NET to Javascript compiler

C# code   Html page   Start
class XmlRequestApp
{
    internal static void Start()
    {
        HtmlDocument document = HtmlDocument.Current;
        HtmlElement statusText = document.GetElementById("status");
        HtmlElement status = document.GetElementById("statusText");
        Control responseText = new Control(document.GetElementById("responseText"));
        new StringWebRequest()
        {
            Url = "data/XmlRequest.xml"
        }.GetXmlDocument(
            delegate (IWebResponse<XmlDocument> response)
            {
                status.InnerText = response.Status.ToString();
                statusText.InnerText = response.StatusText;
                XmlDocument doc = response.Response;
                document.GetElementById("attribute1").InnerText = doc.DocumentElement.GetAttribute("attribute1");
                document.GetElementById("attribute2").InnerText = doc.DocumentElement.GetAttribute("attribute2");
                document.GetElementById("innerText").InnerText = doc.DocumentElement.SelectNodes("Element")[0].InnerText;
                responseText.InnerText = response.Response.DocumentElement.OuterXml;
            },
            delegate (Exception e)
            {
                WebRequestException wre = (WebRequestException)e.FindKnownException(typeof(WebRequestException));
                string error;
                if (wre != null)
                {
                    status.InnerText = wre.Status.ToString();
                    statusText.InnerText = wre.Message;
                    error = wre.ResponseText;
                }
                else
                {
                    error = e.ToString();
                }

                responseText.InnerText = error;
            });
    }
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="x-ua-compatible" content="IE=11;IE=10;IE=9;IE=8;IE=7" />
	<title>XmlRequest.html: String/XmlDocument transfer</title>
	<script type="text/javascript" language="javascript" src="js/XmlRequest.js?v2"></script>
</head>
<body onload="javascript:StartScript()">
    XmlRequest.html: String/XmlDocument transfer
	<table cellpadding="2" cellspacing="0">
		<tr>
			<th>Status</th>
			<td id="status"></td>
		</tr>
		<tr>
			<th>Status</th>
			<td id="statusText"></td>
		</tr>
		<tr>
			<th>attribute 1</th>
			<td id="attribute1"></td>
		</tr>
		<tr>
			<th>attribute 2</th>
			<td id="attribute2"></td>
		</tr>
		<tr>
			<th>Element text</th>
			<td id="innerText"></td>
		</tr>
		<tr>
			<th>Response Text</th>
			<td id="responseText"></td>
		</tr>
	</table>
</body>
</html>
© 2009 JScriptSuite. All rights reserved.