One of the new features of ASP.NET Core 2.1 is, Razor UI as a class library. It makes easier to build and include Razor based UI in a library and share it across multiple projects. A new Razor SDK will enable building Razor files into a class library project that can then be packaged into a NuGet package. You can package your Razor views and pages (.cshtml files) along with your controllers, page models, and data models. Apps can then include pre-built UI components by referencing these packages and customize the UI by overriding specific views and pages. In this post, we’ll see how to create Razor UI as class library and how to reuse it. Read More
Category: ASP.NET Core
.NET Core 3.0 announced: Welcome .NET Core for windows desktop applications
.NET Core 3.0 was announced yesterday at the Microsoft Build event and let’s welcome .NET Core supports for Windows Desktop applications. Finally, this is happening as developers were asking for desktop applications with .NET Core. The highlight of .NET Core 3 is support for Windows desktop applications, specifically Windows Forms, Windows Presentation Framework (WPF), and UWP XAML. You will be able to run new and existing Windows desktop applications on .NET Core and enjoy all the benefits that .NET Core has to offer. Read More
Upgrade Angular 5 app to Angular 6 with Visual Studio 2017
Angular 6 is out!! It’s another major release focused on minimum new features and more on the tooling to make upgrading and adding new libraries a lot easier. Earlier I posted about creating an Angular 5 application with Visual Studio 2017 using ASP.NET Core 2.1 SPA templates. Now, it’s time to upgrade the same angular app to the latest version which is Angular 6. This post talks about how to upgrade Angular 5 app to Angular 6 with Visual Studio 2017. The steps given in this post are applicable to any Angular 5 app, not limited Visual Studio 2017. Read More
Fix for Blazor error BL9986: Component attributes do not support complex content (mixed C# and markup)
Blazor 0.3.0 was released recently, and I thought of upgrading one of my previously created Blazor CRUD app to the recent version 0.3.0. The Blazor app uses a JavaScript function to control the visibility of the HTML controls present in the Todo list element. The HTML elements inside the list are given a dynamic ID to have uniqueness. Like,
<input id="txt_@todo.ID" style="display:none;">
Here, the ID
attribute contains C# and HTML markup. Unfortunately, this gives an error BL9986: Component attributes do not support complex content (mixed C# and markup) while compiling in 0.3.0 version. This is a very common use case in any application to manipulate or apply markup based on the server-side data like applying different CSS classes based on a C# variable. In the first place, I was wondering why Blazor is not allowing this and unfortunately, there is not much help available online to fix it. Read More
Enforce HTTPS in ASP.NET Core Razor Pages
Razor Pages are a new feature of ASP.NET Core 2.0 that makes coding page-focused scenarios easier and more productive. Razor Pages are introduced with the intent of creating page focused scenarios where there is no real logic is involved. You can find all my razor pages posts here. The latest version (2.1) of ASP.NET Core supports HTTPS by default, but at the time of writing this post, it is still in the preview release. You can find all my ASP.NET Core 2.1 posts here. The app built on ASP.NET Core 2.0 version needs to be secured manually. In this post, we will see how to enforce HTTPS in ASP.NET Core Razor Pages applications. Read More
How to Scaffold Identity UI in ASP.NET Core 2.1
One of the new features of ASP.NET Core 2.1 is, Identity as UI library. This new feature saves you from all the hassle of adding and configuring Identity to an ASP.NET Core application. Earlier, I posted about adding Identity as UI in ASP.NET Core 2.1 application and you will find identity UI nuget package is added and no identity code. This is a great feature, but what if you want to customize the UI? Well, ASP.NET Core 2.1.0-preview2 is now available, and it supports scaffolding of identity UI. In this post, let’s see how to scaffold identity UI in ASP.NET Core 2.1 and customize it. Read More
Update: Removed JavaScript dependency from the Blazor CRUD App
Yesterday I posted how to create a CRUD App using Blazor and ASP.NET Core and got a good response from folks on Facebook and Twitter. This Blazor app is using JavaScript for showing/hiding the HTML elements on the page. David Masterson on twitter pointed out that it can be done in another neat way that too without JavaScript and I thought of sharing with you (with his permission) how to update the same CRUD blazor app with no dependency on JavaScript. Read More