.NET 7

Working with Sass in an ASP.NET Core application

calendar_today 20 April 2023 12:40

CSS ASP.NET Core .NET 6 .NET 7 Sass

Sass (Syntactically Awesome Style Sheets) is a is a scripting language that is used to generate cascading style sheets (CSS files). Its syntax is very similar to CSS itself, but it supports the use of variables, nesting, mixins and selector inheritance, none of which are available in CSS itself. However, these features help you to organise and maintain your web application's styles. In this article, I look at the steps required to incorporate and configure Sass in your ASP.NET Core project in both Visual Studio, and VS Code.

Why doesn't my ASP.NET Core 7 web app launch on HTTPS?

calendar_today 20 March 2023 13:37

ASP.NET Core Razor Pages .NET 6 .NET 7

Up until .NET 7, when you use the dotnet run command to run your ASP.NET Core Razor Pages (or MVC) app, the built-in Ketstrel web server would listen on two URLs, one with a http protocol and another that uses the https protocol. This behaviour is documented in many places (including my book) so it might come as a surprise when you run your new .NET 7 app from the command line and it is only available on an http binding. Something changed in .NET 7. What is it and how do you test your .NET 7 web app under https?

Executing async operations onchange in Blazor

calendar_today 10 January 2023 07:35

ASP.NET Core Blazor .NET 7

Blazor's two-way databinding model is extremely powerful, but sometimes it can get in the way of what you want to do. For example, you might want to execute an asynchronous operation such as remote validation when a value changes in a textbox. Perhaps you want to check instantaneously that the value - a username maybe - doesn't already exist in a database before you accept a new registration. You cannot add an onchange event handler if you already have a value bound to the element, so what can you do? In this article, I look at solutions for both HTML elements and EditForm input validation components up to an including .NET 7, and a new feature released in .NET 7.0.1.