Skip to content

Compile Time Errors when assigning HTML content with event handlers to a RenderFragment #12499

@GeeksMinister

Description

@GeeksMinister
Image Image

Inside a razor-file in a @code { }, I'm trying to pass in some HTML content inside a RenderFragment-property as it shows in the 2 images above. The errors [CS1662, CS0027, CS0236] only appears when I try to assign a handler to an event. However, the code compiles and everything renders correctly if the events are not touched as shown in the image below.

Image

Visual Studio 2022 - Version 17.14.20
Visual Studio 2026 Insiders - Version: Insiders [11206.111]

@AdmiralSnyder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions