当前位置: 代码迷 >> ASP.NET >> [紧急]xmlHttp.send(args)的args参数值如何接收
  详细解决方案

[紧急]xmlHttp.send(args)的args参数值如何接收

热度:7133   发布时间:2013-02-25 00:00:00.0
[紧急]xmlHttp.send(args)的args参数值怎么接收?
var   title=vbtrim(document.all.title.value);
var   gpdm=escape(vbtrim(document.all.gpdm.value));
var   url   =   "posttopic1.aspx ";
xmlHttp.open( "POST ",   url,   true);
xmlHttp.onreadystatechange   =   updatePage;
var   args   =   "title= "+escape(title)+ "&message= "+escape(message)+ "&gpdm= "+gpdm;
xmlHttp.send(args);    


在posttopic1.aspx页面怎么接收title,message等参数的值
是用Request.Form还是Request.QuerString

------解决方案--------------------------------------------------------
正好有空,写了个例子

<%@ Page language= "c# " Codebehind= "WebForm13.aspx.cs " AutoEventWireup= "false " Inherits= "WebText.WebForm13 " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> WebForm13 </title>
<meta name= "GENERATOR " Content= "Microsoft Visual Studio .NET 7.1 ">
<meta name= "CODE_LANGUAGE " Content= "C# ">
<meta name= "vs_defaultClientScript " content= "JavaScript ">
<meta name= "vs_targetSchema " content= "http://schemas.microsoft.com/intellisense/ie5 ">
<script language= "javascript ">
function xmlhttp()
{
var A=null;
try
{
A=new ActiveXObject( "Msxml2.XMLHTTP ");
}
catch(e)
{
try
{
A=new ActiveXObject( "Microsoft.XMLHTTP ");
}
catch(oc)
{
if (typeof XMLHttpRequest != "undefined " );
{
A=new XMLHttpRequest();
}
}
}
return A;
}
var oXmlHttp = xmlhttp();
function getReplayResult(memo)
{

try
{
var filterValue=memo

oXmlHttp.open( "POST ", "WebForm14.aspx ",true);
oXmlHttp.setRequestHeader( "content-type ", "application/x-www-form-urlencoded ");
oXmlHttp.send( 'memo= '+filterValue);

oXmlHttp.onreadystatechange = function()


{
if (oXmlHttp.readyState == 4 && oXmlHttp.status == 200)
{

}
}
}
catch (e)
{

}

}
function ss()
{
var tt=document.getElementById( 'memo ').value;
getReplayResult(tt);
}
</script>
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id= "Form1 " method= "post " runat= "server ">
<FONT face= "宋体 "> <TEXTAREA style= "Z-INDEX: 101; LEFT: 32px; WIDTH: 680px; POSITION: absolute; TOP: 8px; HEIGHT: 378px "
rows= "23 " cols= "82 " id= "memo " name= "memo ">
</TEXTAREA> <INPUT style= "Z-INDEX: 102; LEFT: 344px; POSITION: absolute; TOP: 424px " type= "button "
value= "Button " onclick= "ss() "> </FONT>
</form>
</body>
</HTML>


WebForm14.aspx.cs

string ss=Request.Form[ "memo "].ToString();

我传了61.7K的字都可以
  相关解决方案