Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Issues with asp-page-handler in razor

$
0
0

Hi all, me again ;)

For this project:

https://dotnetfiddle.net/VjABOj

I'm having issues with the two select lists and the form page handlers. As is expected, when one handler is fired for a particular form, only controls within the form post their values back to the server.

I've seen examples move to one form element with all controls contained within, and the asp-page-handler tag helper moved to the control, eg:

<select asp-for="@Model.accountCodingView.SelectedAccountTypeCode" asp-items="@Model.accountCodingView.AccountTypes" asp-page-handler="AccountType" class="form-control" onchange="this.form.submit();">

But this doesn't fire the page handler server side and actually doesn't seem to be a supported attribute for <select> lists.

Does anyone have any ideas how to get individual handlers fire per control and still have access to the values of all the controls on the page?

Cheers,

Sam


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>