Skip to main content
Removed Stack Snippets since those are not HTML.
Source Link
Pang
  • 10.2k
  • 146
  • 87
  • 126

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net; using System.Net.Http; using System.Web.Http;

using System.Net; using System.Net.Http; using System.Web.Http; 

If the namespace are as following then it is give above error in web api controller method calling

using System.Web; using System.Web.Mvc;

 
using System.Web; using System.Web.Mvc; 

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net; using System.Net.Http; using System.Web.Http;

If the namespace are as following then it is give above error in web api controller method calling

using System.Web; using System.Web.Mvc;

 

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net; using System.Net.Http; using System.Web.Http; 

If the namespace are as following then it is give above error in web api controller method calling

using System.Web; using System.Web.Mvc; 

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net;</br>Net; using System.Net.Http;</br>Http; using System.Web.Http;</br>Http;

If the namespace are as following then it is give above error in web api controller method calling

using System.Web;</br>Web; using System.Web.Mvc;</br>Mvc;

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net;</br> using System.Net.Http;</br> using System.Web.Http;</br>

If the namespace are as following then it is give above error in web api controller method calling

using System.Web;</br> using System.Web.Mvc;</br>

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net; using System.Net.Http; using System.Web.Http;

If the namespace are as following then it is give above error in web api controller method calling

using System.Web; using System.Web.Mvc;

Source Link
Ujwal Khairnar
  • 548
  • 1
  • 4
  • 19

It is possible due to using MVC controller instead of Web API controller. Check the namespace in Web API controller it should be as following

using System.Net;</br> using System.Net.Http;</br> using System.Web.Http;</br>

If the namespace are as following then it is give above error in web api controller method calling

using System.Web;</br> using System.Web.Mvc;</br>