1.定义变量
2. function saveLines()
{
// debugger;
var gridview1=document.getElementById("<%=GridView1.ClientID%>");
//取其他页面参数
//多行时使用分割符累加,存进数组
........
alert("保存成功!");
AjaxRequestobj();
if(confirm)
{
window.location=window.location;
}
}//function
var http_request = false;
function AjaxRequestobj()
{
var code="";
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('操作失败,请稍后再试!');
return false;
}
else
{
//汉字name需要utf-8编码
name=encodeURIComponent(name);//后台需要解码
http_request.open("GET","page1.aspx?ID1=" +ID1 + "&ID2="+ID2+"&cid="+Math.round(Math.random()*100),true);
http_request.onreadystatechange=procr;
http_request.send();
}
}
function procr()
{
}
//后台处理
private void AjaxRequest(string ID1, string ID2)
{
//多行的处理
string[] ID1 = ID1.Split(',');
//name的解码
name=HttpUtility.UrlDecode(name, Encoding.UTF8);
}