The <text> block is an alternative to the @ character sequence that allows you to denote that an entire portion of a template is content. <text> is useful in scenarios where multiple lines of markup can be interpreted as code or text, such as:
@if(!User.IsAuthenticated)
{
<text> Guests are not allowed to view this content. Please @Html.ActionLink("login", "Login") to view. </text> }
which produces the following output when the user is not authenticated: Guests are not allowed to view this content. Please <a href="/Login">login</a> to view. As you can see, the opening and closing <text> tags are only used within the template to mark the beginning and end of the block of content and are not rendered along with the content. The example also shows that code statements are still perfectly acceptable within a <text> block.
@if(!User.IsAuthenticated)
{
<text> Guests are not allowed to view this content. Please @Html.ActionLink("login", "Login") to view. </text> }
which produces the following output when the user is not authenticated: Guests are not allowed to view this content. Please <a href="/Login">login</a> to view. As you can see, the opening and closing <text> tags are only used within the template to mark the beginning and end of the block of content and are not rendered along with the content. The example also shows that code statements are still perfectly acceptable within a <text> block.