Debendra Dash
Debendra Dash

Reputation: 5596

My Querystring is not hitting my Action Method

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

Upvotes: 0

Views: 33

Answers (1)

Mark Fitzpatrick
Mark Fitzpatrick

Reputation: 1624

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

Upvotes: 1

Related Questions