Tag Helpers - Self closing HTML tags is a bad habit?

后端 未结 1 905
無奈伤痛
無奈伤痛 2021-01-12 21:12

I am incorporating TagHelpers in my MVC vNext project, and I realized they don\'t work when I self close the HTML tags.

@addTagHelper \"*, Micro         


        
1条回答
  •  囚心锁ツ
    2021-01-12 21:39

    The reason they do not work is because the "MVC tag helpers do not change whether an element is self-closing or not" (from comments in issue #4475).

    It is a known issue in ASP.NET and the plan is to show a warning in VS IDE under the scenario of a non-void element having an end tag (see issue #398). One of ASP.NET developers commented in issue #1302 that:

    "this is the current design but we have a few issues (open and closed) on the behaviour"

    0 讨论(0)
提交回复
热议问题