Search code examples
asp.net-mvcrazor-pagestag-helpers

Partial tag helper for razor pages doesn't work


I have problem with partial tag helper when I want to render some partial pages in my view. So problem is that one partial tag placed in my view works fine, but another tag placed below doesn't work. Can someone explain what is causing this problem?enter image description here


Solution

  • You have invalid markup in the div that acts as a container for the Comments. There is an extraneous double quote:

    <div class="col-sm-5 border rounded m-3 card" ">
                                                  ^
    

    You can see a green squiggle underneath it in the image you posted. Razor expects tags and quotes within them to be balanced. Remove that and you should see the second partial acquire the same syntax highlighting as the first one.