Reputation: 58
I have an actionresult method, which accepts a string as parameter, but whenever I query that method with url, that parameter is always null.
abc
is the value of id in routing.
but when I look at the stack trace I dont see method accepting any value.
http://localhost:47268/admin/AllQuarterEvent/abc
public IActionResult AllQuarterEventByMap(string map)
{
return View(_staffMethods.GetQuarterEventsByMap(map));
}
Upvotes: 0
Views: 1192
Reputation: 886
Please try this solution :
[HttpGet("admin/AllQuarterEventByMap/{map}")]
public IActionResult AllQuarterEventByMap([fromRoute] string map)
{
return View(_staffMethods.GetQuarterEventsByMap(map));
}
Upvotes: 1