I have the following code/markup in my Index.cshtml
:
<p>
@Html.ActionLink("Create New", "Create")
@using (Html.BeginForm("Index", "Clients", FormMethod.Get))
{
<p>
Title: @Html.TextBox("search") <br />
<input type="submit" value="Search" />
</p>
}
</p>
Visual Studio 2013 warns me that the last line (</p>
) doesn't have a start tag. I don't have any other <p>
or </p>
tags in the document. What's going on?
Full warning message: End tag is missing matching start tag
.
Two important facts about paragraphs:
p
elements is optional.p
elements cannot contain otherp
elements.This means that:
p
start tag opens the firstp
element.p
start tag closes the firstp
element then opens the secondp
element.p
end tag closes the secondp
element.p
end tag has no openp
element to close.