In-line dynamic content with Razor

If you have some content where you need to add content under certain circumstances, you can do so using some Razor syntax inline.

For an example, lets say you have the following code.

[CSHARP]

Hi there, this is a paragraph.
@if (that == true) {
@: Here is some additional content.
}

[/CSHARP]

If that is indeed true, you’ll get the following result.

Hi there, this is a paragraph. Here is some additional content.

Subscribe

0 comments