title: Error in calling web API in asp .net web forms status code 404
body: <blockquote>
    <p>I have created web API that is working fine  as i checked that, but the problem is when i call that web API in asp .net website here is a code below of calling web API</p>
  </blockquote>
  
  <pre><code>protected void btn_search_Click(object sender, EventArgs e)
  {
      HClient.BaseAddress = new Uri("http://localhost:50653/");
  
      HClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
      BoiMember obj = new BoiMember();
      obj.CustomerId = txt_customerid.Text.Trim();
      obj.AadhaarNo = txt_aadharno.Text.Trim();
      obj.CustomerName = txt_name.Text.Trim();
      obj.AccountNo = txt_accountno.Text.Trim();
      obj.MobileNo = txt_mobile.Text.Trim();
      obj.branchcd = Session["BranchCode"].ToString();
      obj.ZoneCode = Session["ZoneCode"].ToString();
      obj.Campcd = "1";
      obj.ind = 1;
      obj.SourceType = 2;
      obj.UserId = Session["UserName"].ToString();
      string uri = "api/BoiMember/GetRecord/";
      var response = HClient.GetAsync(uri+obj).Result;
  
      if (response.IsSuccessStatusCode)
      {
          var GetData = response.Content.ReadAsAsync&lt;IEnumerable&lt;BoiMember&gt;&gt;().Result;
          GvdRecords.DataSource = GetData;
          GvdRecords.DataBind();
      }
      else
      {
  
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Where in the API controller named <strong>BoiMemberController</strong> when I call this web API without parameters it works fine but as I Pass parameters I get the status code 404 Error not found. My web APIConfig.cs has a code </p>
  </blockquote>
  
  <pre><code>config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate:  "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  </code></pre>