There are four dropdown buttons in the application. The options in the drop-down list are links. The code for one of them:
<li><a asp-controller="Aircrafts" asp-action="Compare"
asp-route-vehicle1="@item.Id">@item.Name</a></li>
@item.Id it's int variable
Controller method taking values:
[HttpGet("compare/{vehicle1}/{vehicle2}/{vehicle3}/{vehicle4}")]
public IActionResult Compare(int vehicle1, int vehicle2, int vehicle3, int vehicle4)
{//код}
Routing:.
endpoints.MapControllerRoute(
name: "FourParameters",
pattern: "controller=Aircrafts}/{action=Compare}/{vehicle1=0}/{vehicle2=0}/{vehicle3=0}/{vehicle4=0}");
Task: When a user clicks on any link of the dropdown, for example, on the third, it is necessary that an address is created like this:
aircrafts/compare/0/0/5/0
and the method in the controller is called, if he clicks on the fourth, then the address should be:
aircrafts/compare/0/0/5/8 etc.
But in my implementation, the controller method is called only after clicking on the fourth dropdown. It's a problem.
