Hi,
I have a razor page where I have two separate forms. Each form will submit and call a separate OnPostAsync method.
To make this happen normally you would use the following:
<input type="submit" value="Submit" asp-page-handler="FormOne"/>
Which would call the method OnPostFormOneAsync().
How do I achieve the same using a TagHelper button, e.g.
<kendo-button name="TestButton" icon="filter" type="submit" asp-page-handler="FormTwo">Test</kendo-button>
Thanks
Russell
4 Answers, 1 is accepted
Currently, the Kendo Core wrappers and the tag helpers do not provide support for the asp-page-handler attribute. However, the native button can be used to provide this functionality, by also setting the k-button class, which will apply the currently used Kendo Theme styling to the button:
<form asp-controller="Home" method="post"><input type="text" id="joe" name="joe" value="Joe" /><button name="TestButton" icon="filter" type="submit" asp-page-handler="FormTwo" class="k-button">Test</button></form>I would also encourage you to log this as a new feature/enhancmenet request in the Kendo UI Feedback Portal. Based on the demand for this feature, it can be considered for implementation in a future release of Kendo.
Regards,
Nencho
Progress Telerik
Good day!
I saw this post from 2018 and wondered if this has changed?
"Currently, the Kendo Core wrappers and the tag helpers do not provide support for the asp-page-handler attribute. However, the native button can be used to provide this functionality, by also setting the k-button class, which will apply the currently used Kendo Theme styling to the button:"
This question is asked partly because of the comment following it:
" would also encourage you to log this as a new feature/enhancement request in the Kendo UI Feedback Portal. Based on the demand for this feature, it can be considered for implementation in a future release of Kendo."
Thank you,
Bill Holman
Hello, William,
Regarding the button - the case is still the same, as it shouldn't matter if you use the kendo-button or the standard one - in terms of layout you can achieve the Kendo look and feel in both cases. That said, the recommendation would be the same - use the standard button with kendo-button styles applied, if you need to get the advantage of the asp-page-handlers.
Regards,
Nencho
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
