求教为何接收不到参数。。

else {
$.ajax({
type: "POST",
url: "addXZYW.aspx/SetBaoCun",
//data: {id: id, mc: mc, mc: mc,engname: engname,shuruma: shuruma,tym: tym},

data: "{id:'" + id + "',mc:'" + mc + "',engname:'" + engname + "',shuruma:'" + shuruma + "',tym:'" + tym + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
error: function (XMLHttpRequest, textStatus, errorThrown) { },
success: function (data) { }
});
};

                            这样后台怎么收不到数据呢?
                            后台:
                            [System.Web.Services.WebMethod]
    public void SetBaoCun(string id, string mc, string engname, string shuruma,string tym)
         {
             //string id1 = id; string mc1 = mc; string engname1 = engname; string shuruma1 = shuruma; string tym1 = tym;
             string sql = string.Format(@"insert into zsk_yaopin(id,name,engname,shuruma1,commonname) values({0},{1},{2},{3},{4})", id, mc, engname, shuruma, tym);
              DbAccess.ExecuteNonQuery(DbAccess.m, CommandType.Text, sql);   


         }
查看全部
lisaer1
lisaer1
2015/09/16 01:19
  • asp.net
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

4个回复