Posts

Showing posts with the label Ajax

Ajax Autocomplete Extender - Passing more parameters to the server c#

<asp:TextBox runat="server" ID="txtName" AutoPostBack="True" CssClass="form-control" OnTextChanged="txtName_TextChanged"></asp:TextBox> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtName" EnableCaching="false" UseContextKey="true" BehaviorID="AutoCompleteCities" OnClientPopulating="autoComplete1_OnClientPopulating" ServiceMethod="GetItem" ServicePath="RequisitionUI.aspx" MinimumPrefixLength="1" CompletionInterval="500" CompletionSetCount="10" FirstRowSelected="true"> ...

Setting multiple choices using jquery chosen pluging

$('#ShopId').val(array).trigger('chosen:updated'); $ ( '#btnshop' ). click ( function () { $ ( '#ShopId' ). chosen ( 'destroy' ). val ([ "shop1" , "shop2" , "shop3" ]). chosen (); });   $.ajax({             url: 'CustomerReport/GetAllShop',             data: {},             success: function (data) {                 var array = [];                 $(data.data).each(function (index, car) {                     array.push(car.ShopID);                 });                 $('#ShopId').val(array).trigger('chosen:updated');             },             error: function () {         ...

ajax calls not working with ASP.Net Web Forms

<script type = "text/javascript" > $ ( document ). ready ( function () { $ . ajax ({ url : '/Default.aspx/GetData' , type : 'POST' , beforeSend : function ( xhr ) { xhr . setRequestHeader ( "Content-type" , "application/json; charset=utf-8" ); }, success : function ( result ) { var resultData = ( result . d ? result . d : result ); alert ( resultData ); }, error : function (){ alert ( 'error' ); } }); }); </script> [ System . Web . Services . WebMethod ] public static string GetData () { return "Hello" ; } Add FriednlyUrls to the project. Remove the line in  RegisterRoutes  method that sets  settings.AutoRedirect...

ASP.NET MVC , Datatables server-side custom paging

Image
By default datatables load all record from database and then use search in client side. but it often cause problem in large data set, to load from database. So i implement custom paging and searching using jqery Bootpag pagination https://codepen.io/SitePoint/pen/jBWOMX  HTML  <div class="col-md-4">         <input type="text" class="form-control" style="float:left;"                 placeholder="Search Style size,Barcode,Product" id="myInputTextField">     </div>      <div class="col-md-12" style="margin-top: -10px;">         <div class="table-responsive" style="margin-top: 0px;">             <table id="dlWarehouseStock" class="display" cellspacing="0" width="100%">        ...