title: Method name not valid webservice
body: <p>I am creating a web app in which I am using the following web service</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(UseHttpGet = true)]
  public void insertarea(string comname, string brandname, string zone, string location, string area)
  {
     string id = "";
     var json = "";
     SqlCommand cmdcom = new SqlCommand("select id from companydetails where comname='" + comname + "'", con);
     con.Open();
     SqlDataReader drcom = cmdcom.ExecuteReader();
     while (drcom.Read())
     {
         id = drcom["id"].ToString();
     }
     con.Close();
     List&lt;object&gt; addarea = new List&lt;object&gt;();
     if (brandname != "select")
     {
         cmd = new SqlCommand("Insert into companyallot values('" + id + "','" + location + "','" + area + "','" + zone + "','" + brandname + "',NULL,NULL,NULL,NULL,NULL)", con);
         con.Open();
         cmd.ExecuteNonQuery();
         json = js.Serialize("Area Added with brandname");
         con.Close();
     }
     else
     {
         cmd = new SqlCommand("Insert into companyallot values('" + id + "','" + location + "','" + area + "','" + zone + "',Null,Null,Null,Null,Null,Null)", con);
         con.Open();
         cmd.ExecuteNonQuery();
         json = js.Serialize("Area Added For All Brands");
         con.Close();
     }
     Context.Response.Write("{" + '"' + "info" + '"' + ":" + json + "}");
  }
  </code></pre>
  
  <p>But I am continuously getting an error</p>
  
  <blockquote>
    <p>System.InvalidOperationException: insertarea Web Service method name is not valid.
       at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
       at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)</p>
  </blockquote>
  
  <p>I tried and changed the method name a few times but still face the same error.
  Does anyone know what is wrong here?</p>
  
  <p>And this is my <code>angularjs</code> function</p>
  
  <pre><code>$scope.updatefunction = function (param) {
     $scope.updateparam = param;
     console.log($scope.updateparam.comarea);
  
     $http.get('/allotcompany.asmx/areaintable', {
        params: {
           comname: $scope.mdcomname,
           brandname: $scope.mdbrandname,
           zone: $scope.mdzone,
           location: $scope.location,
           area: $scope.updateparam.comarea
        }
     }).then(function (response) {
        alert(response.data.info);
        $scope.gettableinfo();
     });
  }
  </code></pre>