0

I'm currently building a Blazor Server application, and migrating code from an old AngularJs / ASP.NET MVC website. Part of that migration includes translating the html in the Angular pages into C# in the .razor pages.

One of my favorite properties in AngularJs was the "ng-if"/"ng-show"/"ng-hide", which allowed just putting a boolean expression into the html tag to determine whether it was visible or even included in the DOM.

In the Blazor app so far I have to instead surround my html with @if statements. While readable, and utterly functional, I would love to be able to put the "if" directly into the html tag itself. Is there a way to do this? (I utterly understand if there isn't)

1
  • See webassemblyman.com/blazor/blazorifelseif.html. Your are sending an HTTP Request which has a URI, Headers, Body. A JSON is a type of body. Not sure why you would translating the html into c#. c# still has webpages in ASP.Net. Commented Aug 12 at 17:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.