I wrote asp.net razor pages web app. On the page/form there are few controls that I want to distinct during the post. Unfortunatly I failed to define custom handler, its always fired thruogh the default OnPost .
on the page:
<form method="post">
<button type="submit" class="btn btn-default" asp-route-data="2" asp-page-handler="custom">Start test 2</button>
</form>
in the module:
public void OnPost()
{
ViewData["confirmation"] = $"from OnPost";
}
public void OnPostcustom(string data)
{
ViewData["confirmation"] = $"from OnPostcustom";//never reach this line
}
what is my fault? according to the documentation it should be a very basic procedure.