前台:$(function () {
$.get("index.ashx", { action: "title" }, function (data) {
var result = eval('(' + data + ')');
$("h1").html(result.name);
$("h5").html(result.cell);
})
})
后台:
string user_id_con = "select use_name,use_cell from dt_User where id=@id";
DataTable dt = DBHelper.GetTable(user_id_con, parameters: new SqlParameter("@id", xx));
return "{"name":"" + dt.Rows[0]["use_name"] + "","cell":"" + dt.Rows[0]["use_cell"] + ""}";