Skip to main content
Home  › ... 2sxc Apps

Razor Blade Tutorials

Tutorial Home

RazorBlade Fluent Tag API TagStart/TagEnd v3

A Tag object also has a .TagStart and .TagEnd property, which just contains that part of the tag, allowing you to place these tags around your work.

The result

This tag was written using both .TagStart and .TagEnd because it may be easier for you that way.

Source Code of this file

Below you'll see the source code of the file. Note that we're just showing the main part, and hiding some parts of the file which are not relevant for understanding the essentials. Click to expand the code

@inherits Custom.Hybrid.Razor14
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
RazorBlade Fluent Tag API TagStart... <!-- unimportant stuff, hidden -->

<h3>The result</h3>
@{
  var successBox = Tag.Div().Class("alert alert-success");
}
@successBox.TagStart
  This tag was written using both <code>.TagStart</code> and <code>.TagEnd</code> 
  because it may be easier for you that way.
@successBox.TagEnd

<!-- unimportant stuff, hidden -->