Skip to content

Clarify Razor's handling of data- attributes #35583

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

Merged

Conversation

ChrisVanDijk
Copy link
Contributor

@ChrisVanDijk ChrisVanDijk commented Jun 5, 2025

Fixes #32916

Added a note explaining that Razor doesn't omit data- attributes with null or false values.


Internal previews

📄 File 🔗 Preview link
aspnetcore/mvc/views/razor.md aspnetcore/mvc/views/razor

ChrisVanDijk and others added 2 commits June 5, 2025 11:55
Fixes dotnet#32916

Added a note explaining that Razor doesn't omit `data-` attributes with null or false values.
@ChrisVanDijk
Copy link
Contributor Author

@dotnet-policy-service agree

Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ChrisVanDijk! 🚀 ... Although our style manual permits "foobar"-named things (see foo, foobar, fubar) in technical content, some of us don't really care for it. Therefore, I changed it to "id" and "active" naming. Also, this doesn't need to be a NOTE. It can just be regular content.

@guardrex guardrex merged commit 99d6b83 into dotnet:main Jun 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documatation on conditional attributes is incomplete.
2 participants