页面:
<input type="button" class="SubmitAdv" οnclick="AddApply()" value="提交" />
cs:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Form["SelectApi"] != null)
{
string result = "";
switch (Request.Form["SelectApi"])
{
case "Submit":
result = GetInfo();
break;
case "ApplyList":
result = ApplyList();
break;
default: break;
}
Response.Clear();
Response.Write(result);
Response.End();
}
}
js:
function AddApply() {
$.ajax({
type: "POST",
url: "xxxx.aspx",
async: true,
data: { SelectApi: "Submit" },
dataType: "text",
success: function (result) {
alert(result);
}
});
}