Working with Sass in an ASP.NET Core application
Mikesdotnetting News Feed
by Mike Brind
1y ago
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 manitain 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 ..read more
Visit website
Executing async operations onchange in Blazor
Mikesdotnetting News Feed
by Mike Brind
1y ago
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 com ..read more
Visit website
Exploring generating PDF files from HTML in ASP.NET Core
Mikesdotnetting News Feed
by Mike Brind
1y ago
Back in 2008, I wrote a series of articles about using iTextSharp to generate PDF files in an ASP.NET application. I still use iTextSharp in a large MVC 5 application that I'm in the process of migrating to ASP.NET Core. The version I use is very old (4.1.6), and the API is very low level so it takes quite a while to write the code required to generate even a moderately complex PDF. Ideally I need a replacement for the new application that can generate PDF files purely from HTML, which is an API I'm much more comfortable with. This ancient version of iTextSharp doesn't support HTML as a source ..read more
Visit website
A reusable generic autocomplete component for Blazor
Mikesdotnetting News Feed
by Mike Brind
1y ago
In my last article, I looked at building a simple autocomplete component within a Blazor WebAssembly application that fetches data dynamically from a database via an API depending on what the user enters into an input. It works nicely but it has not been designed to be reusable. In this article, I look at the steps required to convert the component so that it can be plugged in anywhere within an application and work with any kind of data ..read more
Visit website
Resize images before uploading in Blazor Web Assembly
Mikesdotnetting News Feed
by Mike Brind
1y ago
So, you allow users to upload images to the server from your Blazor WASM app, but you want to constrain the actual dimensions of the image for some reason. Rather than ask the user to edit the image prior to uploading, you decide to to take care of applying this requirement within the application. And you further decide to do any resizing in the browser prior to uploading so that the resulting upload is smaller and you don't have to waste server resources on the procedure. In this article, I take a look at how to do that, and how to get the dimensions of an image file ..read more
Visit website
Incrementally Migrating an ASP.NET Framework application to Razor Pages
Mikesdotnetting News Feed
by Mike Brind
1y ago
Do you have a huge .NET framework application (Web forms, MVC) that relies on authentication and/or System.Web types that you would ideally like to migrate to .NET Core, but just don't have the bandwidth to put everything on hold while you rewrite the entire application on a new framework? If so, you might be interested in an exciting new project from Microsoft - SystemWebAdapters for ASP.NET Core - that enables you to incrementally migrate your old application, endpoint by endpoint ..read more
Visit website
Strongly Typed Middleware in ASP.NET Core
Mikesdotnetting News Feed
by Mike Brind
1y ago
Most ASP.NET Core developers are familiar with the traditional way to author middleware classes which is based on conventions. The vast majority of examples out there feature the convention-based approach. But there is also a strongly typed approach available which is based on implementing the IMiddleware interface. This seems to be one of ASP.NET Core's best kept secrets, so I thought I'd pull the curtains back and let some light shine on it ..read more
Visit website
Using Minimal APIs in ASP.NET Core Razor Pages
Mikesdotnetting News Feed
by Mike Brind
2y ago
If you are using ASP.NET Core Razor Pages to develop your web application, you have already decided that the majority of your HTML will be generated on the server. Nevertheless, chances are that you will want to introduce some client side operations into the application to improve its user friendliness in places. If those operations involve data, you will probably want to work with JSON. From .NET 6, you can use a simplified minimal request handler API that works with JSON by default ..read more
Visit website
Razor Pages Startup in .NET 6
Mikesdotnetting News Feed
by Mike Brind
2y ago
When you create a new web app using .NET 6 (from the new RC1 templates), you might notice something is missing. There is no Startup class. What happened to it? And how do you configure your new .NET 6 web app ..read more
Visit website
I am writing a book about Razor Pages
Mikesdotnetting News Feed
by Mike Brind
2y ago
Just over three years go, when Razor Pages was first launched, I had a number of questions from people asking whether I was going to write a book about the Razor Pages framework. I guess they asked me because Razor Pages appeared to be a natural successor to the old ASP.NET Web Pages framework, and I had written a book about that. Also, I was regularly blogging at the time about all the good things you could do with Razor Pages. The answer then was No, primarily because I was working on my own tutorial/documentation site for Razor Pages - learnrazorpages.com ..read more
Visit website

Follow Mikesdotnetting News Feed on FeedSpot

Continue with Google
Continue with Apple
OR