title: To access controls inside static method
body: <p>In the below code i have a static method i want to access controls like gridview .But it throws object reference error.I tried like the below link :<a href="https://stackoverflow.com/questions/31514188/how-to-acess-page-controls-inside-a-static-method-in-asp-net">How to access page controls inside a static web method?</a>. Pls help me to solve the issue.</p>
  
  <pre><code>     [WebMethod]
              public static void Grade()
  {
       if (HttpContext.Current != null)
                  {
                      Page page = (Page)HttpContext.Current.Handler;
                      GridView gd = (GridView)page.FindControl("gdgrade");//null value
                      DataSet ds = GradeSystem.GradeSystem();
                      gd.DataSource = ds.Tables[0];
                      gd.DataBind();
  
  
                  }
      }
  </code></pre>