Hi I have the following code in razor:
@{ foreach (var item in this.Model) { if (item.Items == null) { @: <li @{if (item.Active) { <text> class="active" </text> } }> if (item.SpanClass == null) { @: <a href="@item.Url" @{ if (item.Active) { <text> class="waves-effect active" </text> } else { <text> class="waves-effect" </text> } }><i class="@item.Icon"></i><span> @item.Text </span></a> }else { @: <a href="@item.Url" @{ if (item.Active) { <text> class="waves-effect active" </text> } else { <text> class="waves-effect" </text> } }><i class="@item.Icon"></i><span> @item.Text <span class="@item.SpanClass">@item.SpanValue</span></span></a> } } @: </li> } } It looks like this:
But I go to:
Then the code format is destroyed:
Any clue?



<li class="@item.ClassName">whereClassNameis either "active" ornull(in the case ofnull, then class name will be omitted from the html)<a href="@item.Url" class="waves-effect @Model.ClassName" ...