title: how to access html control in static function (Asp.net)
body: <p>I m trying to access html controls on my static function but i m getting complie time error 
  so please give me the solution </p>
  
  <p>here is my code </p>
  
  <pre><code>[System.Web.Services.WebMethod]    
  public static void btnPostNote_Click(string note)
  {
      string borrowerId = Data.QueryString("id");
  
      note = "";
      RefreshNotes(borrowerId);
      lblNoteSaved.Text = "Note Successfully Saved
  }
  </code></pre>
  
  <hr>
  
  <p>and i tried the below solution so i got the null pointer exception </p>
  
  <pre><code>[System.Web.Services.WebMethod]
  public static void btnPostNote_Click(string note)
  {
     if (HttpContext.Current != null)
     {
       Page page = (Page)HttpContext.Current.Handler;
       Label lblNoteSaved = (Label)page.FindControl("lblNoteSaved");
       string borrowerId = Data.QueryString("id");
  
       note = "";
       RefreshNotes(borrowerId);
       lblNoteSaved.Text = "Note Successfully Saved";                
     }
  }
  </code></pre>