Sunday, July 21, 2019

Some of the pseudo HTML tags in modern Razor views are intriguing.

Assuming .NET Core 2.2.6, and perhaps in other versions, if you make a "ASP.NET Core Web Application" and specifically a "Web Application (Model-View-Controller)" in Visual Studio 2019 you will see in _Layout.cshtml stuff like this for looping in a partial and showing or hiding stuff based on the environment set in launchSettings.json beneath Properties in the token project made with the new solution.

  1. <partial name="_CookieConsentPartial" />
     
  2. <environment include="Development">
       <p>Hello World</p>
    </environment>

     
  3. <environment exclude="Development">
       <p>Hello Reality</p>
    </environment>
     

No comments:

Post a Comment