20

While randomly browsing through the page source of Stack Overflow, I came across a closing </partial> tag in the page source of Stack Overflow. I went ahead and checked the page source of a few Stack Exchange sites and it seems that this is the case for all pages of all Stack Exchange sites.

This looks like a leftover part of Razor markup, specifically the partial tag helper. The partial tag helper is a self-closing tag:

<partial name="_Xyz" />

and it may have been used like an opening and closing tag:

<partial name=_Xyz"></partial>

And what we see on the source page is the closing tag.

It may also be that a partial view intended to be included is not being included in the page markup.

Partial tag in the source of Meta Stack Exchange

1
  • 3
    Ctrl + Shift + H - Find </partial> Replace: . Ship It! 🚀
    – KyleMit StaffMod
    Feb 2, 2022 at 21:03

1 Answer 1

8

All instances of this issue has been fixed across the codebase, thanks for the heads up! The developer(s) that added these hadn't realized that the tag helper was implemented as self-closing only, which means that .net happily renders <partial ...></partial> as <!-- partial code here --></partial>. The fix was simple - remove the closing partial tags.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .