Skip to content

ASP.NET Core tag helpers don't allow me to escape attributes annotated with @ #5075

@luisabreu

Description

@luisabreu

Hello guys.

While migrating an existing app, I've noticed that the new tag helpers won't let me escape attributes annotated with @. In my case, I have an existing MVC 5 app that I'm migrating to the ASP.NET Core. The existing code looked like this:

<form action="@Url.Action(...)" @@submit="save()">

The server side is trying to use the shortcut notation for Vue's v-on: and the generated HTML looked like this:

<form action="/..." @submit="save()">

When this view got migrated to ASP.NET Core, the code was changed to look like this:

<form asp-action="..." asp-controller="..." @@submit="save()">

However, now the @«submit attribute isn't outputted (it's simply discarded from the generated HTML).

Is this a bug? If that is not the case, how can I output attributes annotated with @?

@thanks.

Luis

Metadata

Metadata

Assignees

Labels

area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.feature-razor-pages

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions