前台页面js:
function request(username)
{
var request = new ActiveXObject("MSXML2.XMLHTTP");
request.open("POST","Default.aspx?t=UISONL&tmp="+Math.random(),false);
request.send("<root u='"+username+"'/>");
var retval = request.responseText;
if(retval.indexOf("<root")<0)
{
alert("null" + retval);
return;
}
var doc = document.createElement("xml");
doc.loadXML(retval);
var root = doc.documentElement;
return root.getAttribute("t");
}
{
var request = new ActiveXObject("MSXML2.XMLHTTP");
request.open("POST","Default.aspx?t=UISONL&tmp="+Math.random(),false);
request.send("<root u='"+username+"'/>");
var retval = request.responseText;
if(retval.indexOf("<root")<0)
{
alert("null" + retval);
return;
}
var doc = document.createElement("xml");
doc.loadXML(retval);
var root = doc.documentElement;
return root.getAttribute("t");
}
Default页cs
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(Request.InputStream);
XmlElement root = doc.DocumentElement;
string userName = root.GetAttribute("u").Trim();
Response.Write("<root u='" + userName + "'/>");
Response.End();
}
{
XmlDocument doc = new XmlDocument();
doc.Load(Request.InputStream);
XmlElement root = doc.DocumentElement;
string userName = root.GetAttribute("u").Trim();
Response.Write("<root u='" + userName + "'/>");
Response.End();
}