当前位置:编程学习 > C#/ASP.NET >>

extjs submit和request问题

//===================extjs前台=========================
  text: 'Go', xtype: 'button', width: 80,
  handler: function () {
       myform.getForm().submit({
           clientValidation: true,
           url: 'http://localhost:20535/Home/submitGo',
               method: 'POST',
               params: {
                    newStatus: 'delivered'
                        },
               success: function (form, action) {
                    alert(11111111);
                    Ext.Ajax.request({
                        url: 'http://localhost:20535/Home/submitGo',
                        method: 'GET',
                        success: function (response)
                        {
                        var respText = Ext.decode(response.responseText);
                        Ext.getCmp('Name').setValue(respText.data[0].Name);
                        Ext.getCmp('Password').setValue(respText.data[0].Password);
                                }
                            });                        
                        },
                    failure: function (form, action) {
                        Ext.Msg.alert('wrong', 'can not find the message');
                        }                    
                });
  }
//======================后台C#====SQL=====================
        public string submitGo()
        {
            //string gName = Request.Form["Name"];
            string gEdit = Request.Form["Edit"];
            string strcon = "Server =.;Database = Yupf;User id = 'yupf';pwd = 'yupf'";
            SqlConnection conn = new SqlConnection(strcon);
            SqlDataAdapter adapter = new SqlDataAdapter(gEdit, conn);
            DataSet ds = new DataSet();
            SqlCommand cmd = new SqlCommand();
            conn.Open();
            cmd.CommandText = gEdit;
            cmd.Connection = conn;
            cmd.ExecuteNonQuery();
            adapter.Fill(ds, "data");

            return "{success:true,data:[{Name:'sdas',Password:'123'}]}";
            string ss = ToJson(ds);
            return ss;
        }


代码如上 form表单上 希望把输入的select查询语句提交到后台 再把执行后的字段内容显示到extjs面板上的textfield中 SQL C# EXTJS --------------------编程问答-------------------- What the fuck!
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,