-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Fix incorrect SelectList selected item documentation and misleading comments #36032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: tdykstra <[email protected]>
@copilot What are the workflows that need to be approved? |
Looking at the repository's workflows, there are several that may require approval:
The main workflow that's most relevant for this PR is the Status checker which validates the documentation build. Since this uses You should see these workflows listed in the "Checks" section of the PR, and any that require approval will show a pending approval status. |
your note says you updated code for 3 .NET versions, but there are versions of the sample app for 5, 6, and 9. The PR should address NET 5, 6, and 9 unless there's some reason not to. |
I updated all sample apps that have Courses functionality:
The cu60 (net6.0) and cu90 (net9.0) directories exist but don't have Courses pages yet - they only have Students pages. cu90 even has a readme.txt stating "Delete this readme file when the code has been updated to .NET 9", indicating it's incomplete. Should I add Courses functionality to cu60 and cu90 by copying from cu50 and updating the target framework? |
No, that would go beyond the scope of the issue. Thank you, nice work on this fix. |
The ASP.NET Core Entity Framework Razor Pages tutorial incorrectly documented how SelectList selection works when using the Select Tag Helper with
asp-for
. The documentation and code comments suggested that theselectedDepartment
parameter in the SelectList constructor controls which option is selected, but this is not true.The Issue
When using the Select Tag Helper with
asp-for
, the selected option is determined by the model property value, not by the SelectList'sselectedDepartment
parameter:Changes Made
Documentation Updates:
selectedDepartment
parameter has no effect when using Select Tag Helper withasp-for
PopulateDepartmentsDropDownList
behavior across all moniker rangesCode Comment Fixes:
The fix ensures developers understand that when using
asp-for="Course.DepartmentID"
, the selected option is automatically determined by the value ofCourse.DepartmentID
, making theselectedDepartment
parameter redundant in this context.Fixes #35375.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Internal previews