0

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));
}

1 Answer 1

1

Please try this solution :

  [HttpGet("admin/AllQuarterEventByMap/{map}")]
  public IActionResult AllQuarterEventByMap([fromRoute] string map)
    {
        return View(_staffMethods.GetQuarterEventsByMap(map));
    }
Sign up to request clarification or add additional context in comments.

1 Comment

How do u do this with a post though

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.