代码之家  ›  专栏  ›  技术社区  ›  Debendra Dash

我的质询没有影响我的行动方式

  •  0
  • Debendra Dash  · 技术社区  · 6 年前

    这是我的行动方法-

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

    当我试图使用query sting来命中我的方法时,它不会命中。

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

    谁能帮我找到我的问题吗。

    enter image description here

    1 回复  |  直到 6 年前
        1
  •  1
  •   Mark Fitzpatrick    6 年前

    您的GlobalSearch已设置为[HttpPost]。您需要将其切换到[HttpGet]