C# 基于querystring从页面url获取json数据
我正在使用一个asp.net应用程序,其中一页数据必须转换为json格式。为此,我在页面加载事件中使用了这段代码C# 基于querystring从页面url获取json数据,c#,asp.net,json,C#,Asp.net,Json,我正在使用一个asp.net应用程序,其中一页数据必须转换为json格式。为此,我在页面加载事件中使用了这段代码 if(Request.QueryString[“AppMode”!=null) { 使用(WebClient wc=new WebClient()) { var json=wc.DownloadString(“http://localhost:1469/WorldVentures/success-故事); } }添加此代码 protected void Page_Load(obj
if(Request.QueryString[“AppMode”!=null)
{
使用(WebClient wc=new WebClient())
{
var json=wc.DownloadString(“http://localhost:1469/WorldVentures/success-故事);
}
}
添加此代码
protected void Page_Load(object sender, EventArgs e)
{
//run when first time page load
if (Page.IsPostBack)
{
//your code
}
}
如果(!IsPostback),是否尝试将此条件放入
中?