0

Here is my Action Method-

[HttpPost]
        [AllowAnonymous]
        public ActionResult GlobalSearch(int searchcategory,string CityName,int? page)
        {
            string categoryName = cobj.GetCategoryNameAsperId(Convert.ToInt32(searchcategory));
            string city = CityName;
}

When i am trying to hit my method using query sting its not hitting.

http://localhost:6004/Classified/GlobalSearch?searchcategory=2002&cityName=Bangalore&page=2 

Can any one please help me finding my issue.

enter image description here

Debendra Dash
  • 5,334
  • 46
  • 38
  • In the method signature it's named `CityName` and in the querystring it's `city`, update that to `CityName`. Addtionally as a side note you're using a bunch of different casing rules, you should try and stick to one set of rules – maxshuty Jan 15 '19 at 18:34

1 Answers1

1

Your GlobalSearch is set for [HttpPost]. You need to switch it to [HttpGet]

Mark Fitzpatrick
  • 1,624
  • 1
  • 11
  • 8