public void
ProcessRequest(HttpContext
context){
context.Response.ContentType = "text/plain"
;
//数据以JSON字符串格式返回
string
strJSON = "{success:true,data:{Name:/"ServerReply/",age:10,email:/"yinzixin1985@hotmail.com/",sex:/"Male/",hobby:/"Football/"}}"
;
//string str = @"{success:true,data:{Name:""ServerReply"",age:10,email:""yinzixin1985@hotmail.com"",sex:""Male"",hobby:""Football""}}";
context.Response.Write(strJSON);
}
注:当Extjs编辑表单时, bookForm.form.load()
//改造书籍修改界面
function loadForm(id){
bookForm.form.load ({//调用表单的加载方法
waitMsg:'正在加载数据请稍候',//提示信息
waitTitle:'提示',
url:'bookex.ashx?action=getBookById',
params:{id:id},
method:'POST',//之前为GET
success:function(form,action){
//Ext.Msg.alert('','数据加载成功');
},
failure:function(form,action){
Ext.Msg.alert('','数据加载失败');
}
});
getBookById传入的值的格式要为{success:true,data: {……}}
extjs拼json串
最新推荐文章于 2018-09-17 15:12:20 发布