Skip to main content

Razor Blade Tutorials

Tutorial HomeRazor.Blade

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.

RazorBlade API Docs


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.

@inherits ToSic.Sxc.Dnn.RazorComponent
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
RazorBlade Fluent Tag API TagStart... <!-- unimportant stuff, hidden -->

@{
  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 -->