[b]1、后台方法[/b]
public string AA(string cc)
{
string dd = "大家好才是真的好";
string message=dd+cc;
return message;
}
[b]前台JS[/b]
function Init() {
var v = "中国";
var s = '<%=AA("' + v + '") %>';
alert(s);
}
[b]2、post提交[/b]
PVISAjax.aspx 为处理的页面
{}中的数据为参数
data 为返回过来的数据
$.post("PVISAjax.aspx", { Method: "PLANT", PlantName: plantName }, function (data) {
if (data != null) {
list = new Array(); //分割字符
list = data.split(",");
var gfoN = list[0];
var grfoN = list[1];
var elN = list[2];
var ulN = list[3];
var etbaN = list[4];
gfo.SetValue(gfoN);
grfo.SetValue(grfoN);
exeuro.SetValue(elN);
exusd.SetValue(ulN);
etba.SetValue(etbaN);
pvisName.SetValue(etbaN);
etba.mainElement.title = etbaN;
}
});
[b]后台[/b]
Convert.ToString(Request["PlantName"]);接收传过来的参数