title: An object reference is required for the nonstatic field, method, or property 'masterpage.fileupload'
body: <p>I am using a static method to upload my image in the project folder but not able to do so as I am getting the error : </p>
  
  <blockquote>
    <p>An object reference is required for the nonstatic field, method, or
    property 'inheritedclass.fileupload'</p>
  </blockquote>
  
  <p>My function is as follows:</p>
  
  <pre><code>[WebMethod]
  public static string FileUploadUsingJqueryNew(string nameofimage)
  {
      string File_Name = nameofimage;       
      FileUploadID.SaveAs(Server.MapPath("~/UploadFile/" + File_Name));
      imgID.ImageUrl = "../UploadFile/" + File_Name;
      imgID.Visible = true;
      return nameofimage;
  }
  </code></pre>