I am building a web application using the ASP.NET C# Core 3.1 MVC and Razor pages.
I am new to Razor pages.
I want to add a button dynamically to the razor page through c#.net core backend code.
I have following sample ASP.NET code syntax that adds the html control present in the string "strForm", to the asp page.
Page.Controls.Add(new LiteralControl(strForm));
What is the equivalent of the above code in C#.NET Core 3.1?
@if(Model.something){ <button></button> }? In other words, try to keep your model and view separate. Raw html in your model should be avoided. But all rules are made to be broken...