Fix duplicate @section Scripts crash on Edit User page

Merging the kiosk PIN script and the role-permissions script into a single
@section Scripts block fixes the InvalidOperationException thrown when Razor
encounters two sections with the same name in the same view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 20:28:08 -04:00
parent 6c2fe6e1c4
commit e124fd5c8b
@@ -306,6 +306,9 @@
</div> </div>
@section Scripts { @section Scripts {
@{
await Html.RenderPartialAsync("_ValidationScriptsPartial");
}
<script> <script>
(function () { (function () {
var userId = '@Model.Id'; var userId = '@Model.Id';
@@ -339,7 +342,7 @@
}); });
document.getElementById('btn-clear-pin').addEventListener('click', function () { document.getElementById('btn-clear-pin').addEventListener('click', function () {
if (!confirm('Clear this employee&apos;s kiosk PIN? They will no longer be able to use the tablet timeclock.')) return; if (!confirm('Clear this employee\'s kiosk PIN? They will no longer be able to use the tablet timeclock.')) return;
pinPost(null).then(function () { pinPost(null).then(function () {
setFeedback('PIN cleared. Employee is now disabled on the kiosk.', 'success'); setFeedback('PIN cleared. Employee is now disabled on the kiosk.', 'success');
}).catch(function (e) { setFeedback(e, 'danger'); }); }).catch(function (e) { setFeedback(e, 'danger'); });
@@ -352,12 +355,6 @@
} }
})(); })();
</script> </script>
}
@section Scripts {
@{
await Html.RenderPartialAsync("_ValidationScriptsPartial");
}
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const roleSelect = document.getElementById('CompanyRole'); const roleSelect = document.getElementById('CompanyRole');