title: call server side method on jquery price slider event which change the datasource of repeater control
body: <p>I am trying to filter results based on user price range selection . so I choose the jquery slider for showing range of price. and I have decided to call web method using jquery <code>ajax</code> on slider <code>stop event</code> . </p>
  
  <p>everything is fine at this stage .here is code for my web method which filter the records basis on min and max range passed by jquery <code>ajax</code> call </p>
  
  <pre><code>[WebMethod]
      public static void FilterByPrice(double min,double max)
      {
          List&lt;BALHotelList&gt; searchresult =(List&lt;BALHotelList&gt;) HttpContext.Current.Session["searchresult"];
          searchresult = searchresult.Where(t =&gt; (double)t.totalPrice &gt;= min &amp;&amp; (double)t.totalPrice &lt;= max).ToList();
          HttpContext.Current.Session["searchresult"] = searchresult;        
          SearchResult s = new SearchResult();
          s.Paging();
      }
  </code></pre>
  
  <p>Now problem is with <code>Paging</code> method which is used to set the <code>datasource</code> of  repeater control . Paging method as follow:</p>
  
  <pre><code> protected  void Paging()
      {
          List&lt;BALHotelList&gt; searchresult = (List&lt;BALHotelList&gt;)Session["searchresult"];
          PagedDataSource objPds = new PagedDataSource();
          objPds.DataSource = searchresult;
          objPds.AllowPaging = true;
          objPds.PageSize = Convert.ToInt32(ddlPageNo.SelectedValue);
  
          objPds.CurrentPageIndex = CurrentPage;
  
          lblCurrentPage.Text = "Page: " + (CurrentPage + 1).ToString() + " of "
             + objPds.PageCount.ToString();
  
          // Disable Prev or Next buttons if necessary
          cmdPrev.Enabled = !objPds.IsFirstPage;
          cmdNext.Enabled = !objPds.IsLastPage;
  
          rptHotels.DataSource = objPds;
          rptHotels.DataBind();
      }
  </code></pre>
  
  <p>when this method is called its through error that <strong>object reference not set</strong> . I understand that this time page controls can not be accessed. as I read some answers which are deny completely this <a href="https://stackoverflow.com/questions/10914336/issue-regarding-access-page-control-from-static-method-asp-net-4-0">issue regarding access page control</a></p>
  
  <p>Now I want to know what approach should I use to complete my task which is </p>
  
  <p><strong>use jquery price slider to filter the records?</strong></p>