Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

TagHelpers won't work in @<text>...</text> code blocks #494

@NTaylorMullen

Description

@NTaylorMullen

Original issue: aspnet/Mvc#2773

MVC does not support using tag helpers in @<text></text> blocks.

I have a method which waits Func<object, HelperResult> type argument to accept html codes sent from views.
It is like:

public void Html(Func<object, HelperResult> html)
{
    //...
}

View code:

@MyObject.Html(@<html><a this-is-a-tag-helper="">Foo</a></html>)

And I receive this error:

The 'await' operator can only be used within an async lambda expression. Consider marking this lambda expression with the 'async' modifier.

 __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

and

await WriteTagHelperToAsync(__razor_template_writer, __tagHelperExecutionContext);

Will this be supported?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions