RZ9986 Component attributes do not support complex content (mixed C# and markup). Attribute: 'href', text: 'mailto:Data.EmailAddress'

RZ9986 Component attributes do not support complex content (mixed C# and markup). Attribute: 'href', text: 'mailto:Data.EmailAddress'

I'm getting this build error with the following format layout

<RadzenDataGridColumn TItem="Contacts" Property="EmailAddress" Title="Email">
    <Template Context="data">
        <a href="mailto:@data.EmailAddress">@data.EmailAddress</a>
    </Template>
</RadzenDataGridColumn>

I'm just needing a link that will open outlook ( or the default mail program).

I tried using <RadzenLink Path="mailto:@data.EmailAddress" Text="@data.EmailAddress"/> but got the same error.

Any suggestion would be appreciated

Hi @Sir_John_Balman,

This is a known Blazor issue with using @ inside strings. The simple workaround is to use string interpolation:

 <a href=@($"mailto:{data.EmailAddress}")>
4 Likes

Thanks for the help!

Thanks Lot, I found so many Years