Skip to content

Need clarification on using @ prefix on Razor component's attribute values #34564

@nicholasyin

Description

@nicholasyin

Description

Image

For one thing, the example below doesn't seem to follow the above convention of not using @ prefix for non-literal variable in attribute values.
In addition, I think adding @ is more reasonable because Count="ct" would intuitively give me the impression that ct is a regular string assigned to Count variable.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-9.0#route-parameters

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/index.md

Document ID

31ad18df-1904-bbdd-cfed-8d0d0267c10e

Article author

@guardrex

Metadata

  • ID: 81a32115-33f8-7d06-aaf0-b8ce918b5527
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions