久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <small id='n68Az'></small><noframes id='n68Az'>

      1. <legend id='n68Az'><style id='n68Az'><dir id='n68Az'><q id='n68Az'></q></dir></style></legend>

        <tfoot id='n68Az'></tfoot>
      2. <i id='n68Az'><tr id='n68Az'><dt id='n68Az'><q id='n68Az'><span id='n68Az'><b id='n68Az'><form id='n68Az'><ins id='n68Az'></ins><ul id='n68Az'></ul><sub id='n68Az'></sub></form><legend id='n68Az'></legend><bdo id='n68Az'><pre id='n68Az'><center id='n68Az'></center></pre></bdo></b><th id='n68Az'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='n68Az'><tfoot id='n68Az'></tfoot><dl id='n68Az'><fieldset id='n68Az'></fieldset></dl></div>
          <bdo id='n68Az'></bdo><ul id='n68Az'></ul>

        使用 Ajax 調(diào)用加載 Asp.Net 中繼器的 JQuery 數(shù)據(jù)表插

        JQuery Datatable Plugin Loading Asp.Net Repeater with Ajax Call(使用 Ajax 調(diào)用加載 Asp.Net 中繼器的 JQuery 數(shù)據(jù)表插件)

                <small id='i5G6Q'></small><noframes id='i5G6Q'>

                  <bdo id='i5G6Q'></bdo><ul id='i5G6Q'></ul>
                  <tfoot id='i5G6Q'></tfoot>
                    <tbody id='i5G6Q'></tbody>
                  <i id='i5G6Q'><tr id='i5G6Q'><dt id='i5G6Q'><q id='i5G6Q'><span id='i5G6Q'><b id='i5G6Q'><form id='i5G6Q'><ins id='i5G6Q'></ins><ul id='i5G6Q'></ul><sub id='i5G6Q'></sub></form><legend id='i5G6Q'></legend><bdo id='i5G6Q'><pre id='i5G6Q'><center id='i5G6Q'></center></pre></bdo></b><th id='i5G6Q'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i5G6Q'><tfoot id='i5G6Q'></tfoot><dl id='i5G6Q'><fieldset id='i5G6Q'></fieldset></dl></div>
                • <legend id='i5G6Q'><style id='i5G6Q'><dir id='i5G6Q'><q id='i5G6Q'></q></dir></style></legend>
                  本文介紹了使用 Ajax 調(diào)用加載 Asp.Net 中繼器的 JQuery 數(shù)據(jù)表插件的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試使用 DataTables 插件為 Ajax 數(shù)據(jù)綁定 Asp.Net 中繼器控件,但它不起作用以下是我的代碼.

                  I am trying to bind Asp.Net Repeater Control for Ajax Data using DataTables Plugin but its not working Following is my Code.

                      $(document).ready(function () {
                                  $('#tblMessages').dataTable({
                                      "sDom": 'T<"clear">lfrtip',
                                      "oLanguage": { "sSearch": "Search the Messages:" },
                                      "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
                                      "iDisplayLength": 25,
                                      "bProcessing": true,
                                      "bServerSide": true,
                                      "bFilter": true,
                                      "sAjaxSource": "../QCDataServices.asmx/GetPatients",
                                      "fnServerData": function(sSource, aoData, fnCallback) {
                                          aoData.push("{pageSize:'20',pageNumber:'1'}");
                                          $.ajax({
                                                  "type": "POST",
                                                  "dataType": 'json',
                                                  "contentType": "application/json; charset=utf-8",
                                                  "url": sSource,
                                                  "data": aoData,
                                                  "success": function (msg) {
                                                      fnCallback(msg.d);
                                                  }
                                              });
                                      },
                                      "sPaginationType": "full_numbers",
                                      "oTableTools": {
                                          "aButtons": [
                                      "copy",
                                      "csv",
                                      "xls",
                                      {
                                          "sExtends": "pdf"
                                      },
                                      "print"
                                  ]
                                      },
                                      "aaSorting": [[0, "desc"]]
                                  });
                              });
                  

                  這是作為Json對象獲得的類

                  Here is the Class which is obtained as Json object

                      public class PatientGridDataSet
                      {
                              public int sEcho { get; set; }
                              public int iTotalRecords { get; set; }
                              public int iTotalDisplayRecord { get; set; }
                              public List<Patient> aaData { get; set; }
                          }
                  

                  這是服務(wù)方法

                          [WebMethod(EnableSession=true)]
                              public PatientGridDataSet GetPatients(int pageSize, int pageNumber)
                              {
                                  var patlist=Patients("", "", "");
                                  return new PatientGridDataSet {sEcho = pageNumber,iTotalRecords =         patlist.Count, iTotalDisplayRecord = pageSize, aaData= patlist.Skip(pageSize * pageNumber).Take(pageSize).ToList() };
                              }
                              [WebMethod(EnableSession = true)]
                              public List<Patient> Patients(string searchIn, string Operator, string         searchString)
                              {
                                  List<Patient> result;
                                  try
                                  {
                                      DataRow[] rows;
                                      var table = new dsVw_Patients.vw_PatientsDataTable();
                                      var adapter = new vw_PatientsTableAdapter();
                                      adapter.Fill(table);
                                      //DataTable distinctTable = originalTable.DefaultView.ToTable(         /*distinct*/ true);
                                      string hid = Context.Session["HospitalId"] == null ? "0" :         Context.Session["HospitalId"].ToString();
                                      string rid = Context.Session["RoleId"] == null ? "0" :         Context.Session["RoleId"].ToString();
                                      string uid = Context.Session["UserId"] == null ? "0" :         Context.Session["UserId"].ToString();
                                      if (searchIn.Equals(""))
                                      {
                                          rows = hid.Equals("0") ?         table.DefaultView.ToTable(true).Select("1=1", "PatientName ASC") : table.DefaultView.ToTable(true).Select("HospitalId="+hid, "PatientName ASC");
                                          if(rid.Equals("5"))
                                              rows = table.DefaultView.ToTable(true).Select("UserId="+uid,         "PatientName ASC");
                                      }
                                      else
                                      {
                                          if (hid.Equals("0"))
                                          {
                                              rows = Operator.Contains("%") ?         table.DefaultView.ToTable(true).Select(searchIn + " like '" + Operator.Replace("_", searchString) + "'", searchIn + " ASC") : table.DefaultView.ToTable(true).Select(searchIn + " " + Operator + " '" + searchString + "'", searchIn + " ASC");
                                          }
                                          else
                                          {
                                              rows = Operator.Contains("%") ?         table.DefaultView.ToTable(true).Select("HospitalId=" + hid+" and "+searchIn + " like '" + Operator.Replace("_", searchString) + "'", searchIn + " ASC") : table.DefaultView.ToTable(true).Select("HospitalId=" + hid + " and " + searchIn + " " + Operator + " '" + searchString + "'", searchIn + " ASC");
                                          }
                                          if (rid.Equals("5"))
                                          {
                                              rows = Operator.Contains("%") ?         table.DefaultView.ToTable(true).Select(searchIn + " like '" + Operator.Replace("_", searchString) + "'", searchIn + " ASC") : table.DefaultView.ToTable(true).Select(searchIn + " " + Operator + " '" + searchString + "'", searchIn + " ASC");
                                          }
                                      }
                  
                                      var tieup=new clsTieUpCompanies();
                                      result = rows.Select(row => new Patient
                                                                      {
                                                                          PatientId =         Convert.ToInt32(row["PatientId"]), PatientName = row["PatientName"].ToString(), Address = row["Address"].ToString(), Street = row["Street"].ToString(), City = row["City"].ToString(), ContactNo = row["Contactno"].ToString(), MobileNo = row["MobileNo"].ToString(), Email = row["Email"].ToString(), State = row["State"].ToString(), Country = row["Country"].ToString(), BPLCardNo = row["BPLCardNo"].ToString(), Company = tieup.GetTieupCompanyName(Convert.ToInt32(row["CompanyId"]))
                                                                      }).ToList();
                                  }
                                  catch (Exception)
                                  {
                                      result = null;
                                  }
                                  return result;
                              }
                  

                  首先,當(dāng)我調(diào)用我的 web 服務(wù)方法時(shí),它不會(huì)去那里,請告訴我其余代碼是否正常這是標(biāo)記

                  First Of when i call my webservice method it does not go there please tell me rest code is ok or not Here is the markup

                        <asp:Repeater ID="rptList" runat="server">
                          <HeaderTemplate>
                              <table id="tblMessages">
                                  <thead>
                                      <tr>
                                          <th>
                                              Patient Name
                                          </th>
                                          <th>
                                              Address
                                          </th>
                                          <th>
                                              City
                                          </th>
                                          <th>
                                              Contact No
                                          </th>
                                          <th>
                                          MobileNo
                                          </th>
                                          <th>
                                          BPL Card No.
                                          </th>
                                      </tr>
                                  </thead>
                                  <tbody>
                          </HeaderTemplate>
                          <ItemTemplate>
                              <tr>
                                  <td>
                                      <%# Eval("PatientName")%>
                                  </td>
                                  <td>
                                      <%#Eval("Address")%>
                                  </td>
                                  <td>
                                      <%# Eval("City")%>
                                  </td>
                                  <td>
                                      <%# Eval("ContactNo")%>
                                  </td>
                                  <td>
                                    <%# Eval("MobileNo")%>
                                  </td>
                                  <td>
                                    <%# Eval("BPLCardNo")%>
                                  </td>
                              </tr>
                          </ItemTemplate>
                          <FooterTemplate>
                              </tbody> </table>
                          </FooterTemplate>
                      </asp:Repeater>
                  

                  推薦答案

                  @Tim B James

                  @Tim B James

                  我已經(jīng)成功了.但是我嘗試使用它的真正原因是無視的.僅獲取 80 條記錄需要花費(fèi)大量時(shí)間.在這里找到我的客戶端代碼.

                  I have got it worked.But the very reason i tried used it for is defied. It takes a lot of time to fetch only 80 records. Here Find my client code.

                      $(document).ready(function () {
                                  var grid = $('#tblMessages').dataTable({    
                                       "sDom": 'T<"clear">lfrtip',
                                      "oLanguage": { "sSearch": "Search the Messages:" },
                                      "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
                                      "iDisplayLength": 25,                
                                      "oTableTools": {
                                          "aButtons": [
                                      "copy",
                                      "csv",
                                      "xls",
                                      {
                                          "sExtends": "pdf"
                                      },
                                      "print"
                                  ]
                                      },    
                                      "bProcessing": true,
                                      "bSort": true,
                                      "sPaginationType": "full_numbers",                
                                      "bServerSide": true,                                
                                      "sAjaxSource": "../QCDataServices.asmx/GetPatients",                                
                                      "fnServerData": function (sSource, aoData, fnCallback) {
                                          var jsonAOData = JSON.stringify(aoData);
                                          $.ajax({
                                              type: "POST",
                                              //dataType: "json",
                                              contentType: "application/json; charset=utf-8",
                                              url: sSource,
                                              data: "{jsonAOData : '" + jsonAOData + "'}",
                                              success: function (msg) {                            
                                                  fnCallback(JSON.parse(msg.d));
                                              },
                                              error: function (XMLHttpRequest, textStatus, errorThrown) {
                                                  alert(XMLHttpRequest.status);
                                                  alert(XMLHttpRequest.responseText);
                  
                                              } 
                                          });
                                      },
                  
                                      "aoColumnDefs": [
                                          { "fnRender": function (oObj) {
                                              return "<a href='../FrmMessage.aspx?id='" +         oObj.aData[0] + "><img src='../../images/SMS.png'/></a>";
                                          },
                                              "bSortable": false,
                                              "aTargets": [0]
                                          },
                                          { "sName": "PatientName",
                                              "bSearchable": true,
                                              "aTargets": [1]
                                          },
                                          { "sName": "Address",
                                              "bSearchable": true,
                                              "bSortable": true,
                                              "aTargets": [2]
                                          },
                                          { "sName": "ContactNo", "aTargets": [3] },
                                          { "sName": "MobileNo", "aTargets": [4] },                   
                                          { "sName": "BPL Card No", "aTargets": [5] }
                                      ]
                                  });
                                  grid.fnSetFilteringDelay(1000);
                              });
                  

                  我已使用此鏈接提供的解決方案http://activeengine.wordpress.com/2011/02/09/datatablepager-now-has-multi-column-sort-capability-for-datatables-net/

                  I have used Solution provided by this link http://activeengine.wordpress.com/2011/02/09/datatablepager-now-has-multi-column-sort-capability-for-datatables-net/

                  我的網(wǎng)絡(luò)服務(wù)方法是

                       [WebMethod(EnableSession = true)]
                       [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
                       public string GetPatients(string jsonAOData)
                       {         
                           var patients= Patients("", "", "");            
                           var dataTablePager = new DataTablePager<Patient>(jsonAOData, patients);
                           var formattedList = dataTablePager.Filter();
                           return JsonConvert.SerializeObject(formattedList);           
                       }
                  
                       [WebMethod(EnableSession = true)]
                      public IQueryable<Patient> Patients(string searchIn, string Operator, string searchString)
                      {
                          IQueryable<Patient> result ;
                          try
                          {
                              DataRow[] rows;
                              var table = new dsVw_Patients.vw_PatientsDataTable();
                              var adapter = new vw_PatientsTableAdapter();
                              adapter.Fill(table);
                              //DataTable distinctTable = originalTable.DefaultView.ToTable( /*distinct*/ true);
                              var hid = Context.Session["HospitalId"] == null ? "0" : Context.Session["HospitalId"].ToString();
                              var rid = Context.Session["RoleId"] == null ? "0" : Context.Session["RoleId"].ToString();
                              var uid = Context.Session["UserId"] == null ? "0" : Context.Session["UserId"].ToString();
                              if (searchIn.Equals(""))
                              {
                                  rows = hid.Equals("0") ? table.DefaultView.ToTable(true).Select("1=1", "PatientName ASC") : table.DefaultView.ToTable(true).Select("HospitalId="+hid, "PatientName ASC");
                                  if(rid.Equals("5"))
                                      rows = table.DefaultView.ToTable(true).Select("UserId="+uid, "PatientName ASC");
                              }
                              else
                              {
                                  if (hid.Equals("0"))
                                  {
                                      rows = Operator.Contains("%") ? table.DefaultView.ToTable(true).Select(searchIn + " like '" + Operator.Replace("_", searchString) + "'", searchIn + " ASC") : table.DefaultView.ToTable(true).Select(searchIn + " " + Operator + " '" + searchString + "'", searchIn + " ASC");
                                  }
                                  else
                                  {
                                      rows = Operator.Contains("%") ? table.DefaultView.ToTable(true).Select("HospitalId=" + hid+" and "+searchIn + " like '" + Operator.Replace("_", searchString) + "'", searchIn + " ASC") : table.DefaultView.ToTable(true).Select("HospitalId=" + hid + " and " + searchIn + " " + Operator + " '" + searchString + "'", searchIn + " ASC");
                                  }
                                  if (rid.Equals("5"))
                                  {
                                      rows = Operator.Contains("%") ? table.DefaultView.ToTable(true).Select(searchIn + " like '" + Operator.Replace("_", searchString) + "'", searchIn + " ASC") : table.DefaultView.ToTable(true).Select(searchIn + " " + Operator + " '" + searchString + "'", searchIn + " ASC");
                                  }
                              }
                              //.Skip(pageSize*pageNumber).Take(pageSize).ToList().
                              var tieup=new clsTieUpCompanies();
                              result = rows.Select(row => new Patient
                                                              {
                                                                  PatientId = Convert.ToInt32(row["PatientId"]), PatientName = row["PatientName"].ToString(), Address = row["Address"].ToString(), Street = row["Street"].ToString(), City = row["City"].ToString(), ContactNo = row["Contactno"].ToString(), MobileNo = row["MobileNo"].ToString(), Email = row["Email"].ToString(), State = row["State"].ToString(), Country = row["Country"].ToString(), BPLCardNo = row["BPLCardNo"].ToString(), Company = tieup.GetTieupCompanyName(Convert.ToInt32(row["CompanyId"]))
                                                              }).AsQueryable();
                          }
                          catch (Exception)
                          {
                              result = null;
                          }
                          return  result;
                      }
                  

                  請指導(dǎo)如何提高性能.

                  這篇關(guān)于使用 Ajax 調(diào)用加載 Asp.Net 中繼器的 JQuery 數(shù)據(jù)表插件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  GoogleWebAuthorizationBroker in MVC For Google Drive Access(MVC 中的 GoogleWebAuthorizationBroker 用于 Google Drive 訪問)
                  Why do I get System.UnauthorizedAccessException Access to the path #39;Google.Apis.Auth#39; is denied(為什么我得到 System.UnauthorizedAccessException 對路徑“Google.Apis.Auth的訪問被拒絕) - IT屋-程序員軟件開發(fā)技術(shù)分享
                  Dynamically built SiteMapPath in asp.net(在 asp.net 中動(dòng)態(tài)構(gòu)建的 SiteMapPath)
                  ASP.NET Exception: The remote name could not be resolved: #39;apiconnector.com#39;(ASP.NET 異常:無法解析遠(yuǎn)程名稱:“apiconnector.com)
                  Does a MasterPage know what page is being displayed?(MasterPage 是否知道正在顯示的頁面?)
                  ASP.net MVC - Navigation and highlighting the quot;currentquot; link(ASP.net MVC - 導(dǎo)航和突出顯示“當(dāng)前;關(guān)聯(lián))

                    <small id='iFu7d'></small><noframes id='iFu7d'>

                          <tbody id='iFu7d'></tbody>

                        <legend id='iFu7d'><style id='iFu7d'><dir id='iFu7d'><q id='iFu7d'></q></dir></style></legend>

                          • <bdo id='iFu7d'></bdo><ul id='iFu7d'></ul>
                            <tfoot id='iFu7d'></tfoot>
                            <i id='iFu7d'><tr id='iFu7d'><dt id='iFu7d'><q id='iFu7d'><span id='iFu7d'><b id='iFu7d'><form id='iFu7d'><ins id='iFu7d'></ins><ul id='iFu7d'></ul><sub id='iFu7d'></sub></form><legend id='iFu7d'></legend><bdo id='iFu7d'><pre id='iFu7d'><center id='iFu7d'></center></pre></bdo></b><th id='iFu7d'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iFu7d'><tfoot id='iFu7d'></tfoot><dl id='iFu7d'><fieldset id='iFu7d'></fieldset></dl></div>
                            主站蜘蛛池模板: 一级毛毛片| 九九久久国产 | 91精品国产高清久久久久久久久 | 日韩在线视频一区 | 色天天综合 | 国产成人黄色 | 亚洲成人精品一区 | 欧美日韩在线电影 | 中国毛片免费 | 国产亚洲欧美日韩精品一区二区三区 | 国产欧美日韩久久久 | 一级黄色片毛片 | 国产ts人妖系列高潮 | 午夜免费视频 | 国产高清视频在线观看 | 日韩视频一区二区三区 | 国产69精品久久久久777 | 欧美成人第一页 | 韩国av一区二区 | 亚洲成人精品 | 日韩三级电影一区二区 | 婷婷色在线播放 | 久草.com | 国产精品自在线 | 99资源站| 成人在线一区二区 | 亚洲一区中文 | 日韩伦理一区二区 | 欧美天堂一区 | 中文字幕高清av | 一区二区三区高清不卡 | www.97zyz.com | 日韩一区二区在线观看视频 | 国产蜜臀97一区二区三区 | 在线免费观看黄网 | xxx.在线观看| 色综合久久久久 | 99re热精品视频 | 乱码av午夜噜噜噜噜动漫 | 久久人爽| 美日韩精品 |