User618007423 posted
Could someone tell me why I am getting the above error? Thank you. The first code snippet is default.aspx.cs and the second is an external LoadXMLDoc.js.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Xml;
namespace NBSWorkOrder
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
var xmlDoc = loadXMLDoc("books.xml");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
}
function loadXMLDoc(filename) {
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
}
else // code for IE5 and IE6
{
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET", filename, false);
xhttp.send();
return xhttp.responseXML;
}