i have a c# class, when we compile it will generate a javascript code using saltarelle dlls(Saltarelle.jQuery, Saltarelle.Linq, saltarelle.QUnit, Saltarelle.web)
Now i need some code in javascript as shown below
var xmlHttp = new XMLHttpRequest();
var para = "id=testid&name=testname";
xmlHttp.open("POST", "http://cef", false);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
alert("beforeDone");
xmlHttp.send(JSON.stringify({ name: "John Rambo", time: "2pm" }));
alert("almostDone");
var result = xmlHttp.status;
if (xmlHttp.readyState == 4) { if (result == 200) { var response = xmlHttp.responseText; alert(response); } }
i have written C# code to auto generate the JS file as below
var xmlHttp = new XMLHttpRequest();
var para = "id=testid&name=testname";
xmlHttp.open("POST", "http://testdomain", false);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(para);
var result = xmlHttp.status;
if (xmlHttp.readyState == 4)
{
if (result == 200)
{
var response = xmlHttp.responseText;
}
}
While compiling am getting error while creating an object of XMLHttpRequest();
Error 1 The type or namespace name 'XMLHttpRequest' could not be found (are you missing a using directive or an assembly reference?) D:\Views\HostInteraction\HostInteraction.cs
Hello every one,
i have a c# class, when we compile it will generate a javascript code using saltarelle dlls(Saltarelle.jQuery, Saltarelle.Linq, saltarelle.QUnit, Saltarelle.web)
Now i need some code in javascript as shown below
var xmlHttp = new XMLHttpRequest();
var para = "id=testid&name=testname";
i have written C# code to auto generate the JS file as below
var xmlHttp = new XMLHttpRequest(); var para = "id=testid&name=testname";
While compiling am getting error while creating an object of XMLHttpRequest();
Error 1 The type or namespace name 'XMLHttpRequest' could not be found (are you missing a using directive or an assembly reference?) D:\Views\HostInteraction\HostInteraction.cs