时间:2021-07-01 10:21:17 帮助过:26人阅读
//后台cs代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Login_jg : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string get()
{
string name=this.Request["name"]; // 从另一页获取参数,可以不需要!
string json = "{Name:'" + name + "',Number:'"15"' + "'}";
return json;
}
}
前台代码:
代码如下:
var dpinfo = "<%=get() %>";
var dpjson = eval("(" + dpinfo + ")");
alert(dpjson.Name);