In my view I have two buttons that pass parameters via GET to the index of my controller, the problem is that the URL does not stay with the traditional? id = 1 and I wanted to make it look like this: / controller / 1
View:
@using (Html.BeginForm(FormMethod.Get))
{
<button type="submit" class="btn btn-primary" value="1" name="id">sites1</button>
<button type="submit" class="btn btn-primary" value="2" name="id">sites2</button><br />
}
Controller:
public async Task<IActionResult> Index(int? id)
{
var listaDeSites = await _listaService.ListaDeSitesAsync(id);
return View(listaDeSites);
}