'Razor: Why isn't this button passing an argument to the OnGet method of the directed page

I have the following button in a .schtml file:

<form method="get">
    <button asp-page="/SavedQueries" type="submit" asp-route-input="@Model._input">Save Query</button>
</form>

Which calls the OnGet() method of the SavedQueries.cshtml.cs page:

public void OnGet(MatchingInput<PinInformation<int>> input)
        {
            DoStuff()
        }

But the object I passed into the asp-route-input field is not passed across and then the OnGet method is called with a new instantiation of the class



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source