Skip to content

Verify markup in local functions and @functions codeblocks #10803

@mkArtakMSFT

Description

@mkArtakMSFT

We added the ability to provide markup in local functions i.e.

@{
    void Foo()
    {
        <p>The time is @DateTime.Now</p>
    }
}

@{ Foo(); }

and in @functions blocks:

@functions {
    void Foo()
    {
        <p>The time is @DateTime.Now</p>
    }
}

@{ Foo(); }

This feature set should be functionally validated for Razor views. To make this set of features work in Components is a little more time consuming and not fully designed. i.e. you need to pass in extra parameters into your methods in order to utilize markup in the @functions block. Despite it not being fully designed it should still work in Components as well.

Copied from: https://github.com/aspnet/Release/issues/335
Please see referenced issue fore more details.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedValidationThis issue is used to track validation effortsarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions