The Problem This link:
<a href="/Home/FreeCoffee">
…generates a GET request to /Home/FreeCoffee, but your controller method only accepts POST:
[HttpPost]
[Route("Home/FreeCoffee")]
public async Task<IActionResult> FreeCoffee(...)
So when you click the "Coffee" link in your dropdown menu, it tries to access that URL with a GET request — and the server replies with 405 Method Not Allowed because no GET endpoint exists for /Home/FreeCoffee.
Option 1: Move the form to a separate view (recommended for better UX) If the "Coffee" dropdown item is meant to open a page with the form, then you should do this:
Create a GET action that renders a view with the phone number form:
[HttpGet]
public IActionResult FreeCoffee()
{
return View();
}