1. Background method
Copy Code code as follows:
public string AA (string cc)
{
string dd = "Everyone is good is really good";
String message=dd+cc;
return message;
}
Front desk JS
Copy Code code as follows:
function Init () {
var v = "China";
var s = ' <%=aa ("' + V + '")%> ';
alert (s);
}
2, Post submission
Pvisajax.aspx for processed pages
The data in {} is a parameter
Data is returned by
Copy Code code as follows:
$.post ("Pvisajax.aspx", {method: "Plant", plantname:plantname}, function (data) {
if (data!= null) {
List = new Array (); Split character
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;
}
});
Backstage
Convert.ToString (request["Plantname"); Receive passed parameters