C# 使用ajax在Jquery对话框中编辑

C# 使用ajax在Jquery对话框中编辑,c#,jquery,ajax,asp.net-ajax,C#,Jquery,Ajax,Asp.net Ajax,我有一个Jquery对话框,我想用它来编辑信息,但是我需要ajax来填充我将在文本框中编辑的信息,但是我的ajax调用似乎有问题,因为它无法检索信息。我认为问题在于响应,有人能看一下我的代码吗?谢谢 <script type="text/javascript"> function ShowDialog(RowID) { //alert(RowID); $("#EditTable").dialog({ autoOpen: t

我有一个Jquery对话框,我想用它来编辑信息,但是我需要ajax来填充我将在文本框中编辑的信息,但是我的ajax调用似乎有问题,因为它无法检索信息。我认为问题在于响应,有人能看一下我的代码吗?谢谢

  <script type="text/javascript">
       function ShowDialog(RowID) {
      //alert(RowID);
      $("#EditTable").dialog({
          autoOpen: true,
          width: 300,
          height: 300,
          modal: true,

          open: function () {
              $.ajax({
                  type: 'POST',
                  url: 'TestMultipleWebMail.aspx/EditRecord',
                  data: '{"RowID":"' + RowID + '"}',
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  async: "true",
                  success: function (msg) {
                      var msg = eval('(' + response.d + ')');

                      $("#Esupartnerno").val(msg.SUPartnerNo);
                      $("#Ename").val(msg.UserName);
                      $("#Eemail").val(msg.EMail);
                      $("#Ebranchno").val(msg.TakNo);
                  },
                  error: function (response) {
                      alert(response.status + '' + response.statusText);
                  }
              });
          },
          buttons:
          {
              "Cancel": function () {
                  $(this).dialog("close");
              },

              "Update": function () {

              }
          }
      });

    }
   </script>


    [WebMethod] /// edit
    public static string EditRecord(string RowID)
    {
        string data = string.Empty;

        BLDAL blDAL = new BLDAL(BLDAL.GetConnectionString(System.Configuration.ConfigurationManager.AppSettings.Get("ConnectionString")));

        blDAL.LoadMultipleWebMailGetinfo(RowID);


        return data;
       }

函数ShowDialog(RowID){
//警报(RowID);
$(“#编辑表”)。对话框({
自动打开:对,
宽度:300,
身高:300,
莫代尔:是的,
打开:函数(){
$.ajax({
键入:“POST”,
url:'TestMultipleWebMail.aspx/EditRecord',
数据:“{”RowID:“'+RowID+''”}”,
contentType:“应用程序/json;字符集=utf-8”,
数据类型:“json”,
异步:“真”,
成功:功能(msg){
var msg=eval('('+response.d+'));
$(“Esupartnerno”).val(msg.SUPartnerNo);
$(“#Ename”).val(msg.UserName);
$(“#Eemail”).val(msg.EMail);
$(“#Ebranchno”).val(msg.TakNo);
},
错误:函数(响应){
警报(response.status+''+response.statusText);
}
});
},
按钮:
{
“取消”:函数(){
$(此).dialog(“关闭”);
},
“更新”:函数(){
}
}
});
}
[WebMethod]///编辑
公共静态字符串EditRecord(字符串RowID)
{
字符串数据=string.Empty;
BLDAL BLDAL=new BLDAL(BLDAL.GetConnectionString(System.Configuration.ConfigurationManager.AppSettings.Get(“ConnectionString”)));
blDAL.LoadMultipleWebMailGetinfo(RowID);
返回数据;
}

不,人们不会查看您的代码。关于异常/错误/意外行为的详细信息,请更加具体。哪一行引起了你的问题?这一行引起了问题。成功:函数(msg){var msg=eval('('+response.d+'));有什么问题吗?您是否检查了response是否具有预期的值?