<mce:script type="text/javascript"><!-- Ext.onReady(function(){ Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; var config = { title:'表单加载示例', labelWidth:100, width:300, frame:true, labelSeparator:':', renderTo:'form', items:[ //同步加载表单数据 new Ext.form.TextField({ fieldLabel:'产品名称', name:'productName', width:150, value:'U盘' }), new Ext.form.NumberField({ fieldLabel:'金额', name:'price', width:150, value:100 }), new Ext.form.DateField({ fieldLabel:'生产日期', format:'Y年m月d日', width:150, name:'date', value:new Date() }), //异步加载表单数据 new Ext.form.TextArea({ id:'introduction', //name:'introduction', fieldLabel:'产品简介', width:150 }) ], buttons:[ new Ext.Button({ text:'加载简介', handler:loadCallBack }) ] } var productForm = new Ext.form.FormPanel(config); //按钮事件处理,异步加载表单数据 function loadCallBack() { productForm.form.load({ waitMsg:'正在加载产品简介信息', waitTitle:'提示', url:'API/productServer.ashx', method:'GET', success:function(form,action){ Ext.Msg.alert('提示','产品信息加载成功!'); }, failure:function(form,action){ Ext.Msg.alert('提示','产品简介加载失败<br/>原因:' + action.failureType); } }); } }); // --></mce:script> using System; using System.Web; public class productServer : IHttpHandler { public void ProcessRequest (HttpContext context) { //异步加载表单数据格式 string msg = @"{success:true, data:{introduction:'本产品实用美观,售后服务优秀!'} }"; context.Response.Write(msg); } public bool IsReusable { get { return false; } } }