A collection of articles and tutorials on web development with ASP.NET by Mike Brind

Latest Entries

Cascading Dropdowns With Blazor

24 May 2018 20:51

ASP.NET Core Blazor

Blazor is an experimental framework introduced by Steve Sanderson of Knockout.js fame (among other things) on the ASP.NET team. The premise of the framework is simple, but potentially game-changing for ASP.NET developers: it enables you to write your client side code in C#. What this means is that rather than having to chase after the latest Javascript-based hotness - Aurelia, React, Angular etc, only to find that they are dependent on learning a whole new load of frameworks, or that they are no longer flavour of the week, you just use the .NET skills that you already have to move your processing to the browser.

Click to read more about Cascading Dropdowns With Blazor ...

Viewed 864 times

Working With JSON in Razor Pages

21 May 2018 13:49

ASP.NET Core Razor Pages

UI generation and processing within web applications is moving increasingly to the client. Data processing and storage is still undertaken on the server, with JSON being the preferred format for exchanging data between the server and the client. There are a number of ways in which you can generate JSON when working with Razor Pages. This article explores some of them.

Click to read more about Working With JSON in Razor Pages ...

Viewed 1293 times

Extending the Command Timeout in Entity Framework Core Migrations

26 March 2018 08:50

Entity Framework ASP.NET Core

Most migrations that you execute when working with Entity Framework Core are likely to be straightforward - resulting in nothing more than an adjustment to the database schema. Sometimes, however, you might also want to include a task that requires longer than the default command timeout value (30 seconds in SQL Server) such as importing a lot of data.

Click to read more about Extending the Command Timeout in Entity Framework Core Migrations ...

Viewed 749 times

Publishing Razor Pages Applications - Gotchas

22 March 2018 08:15

ASP.NET Core Razor Pages

I have just completed an article covering publishing a Razor Pages application to IIS on my Razor Pages dedicated site: learnrazorpages.com. While writing it (and publishing revised versions of the site) I uncovered a few stumbling blocks that might catch others out. So I thought they were worth highlighting here in their own post.

Click to read more about Publishing Razor Pages Applications - Gotchas ...

Viewed 826 times

ViewModels and AutoMapper in Razor Pages

14 February 2018 08:13

ASP.NET Core Razor Pages

The Razor Pages PageModel class is part controller, part ViewModel. In this article, I take a look at the ViewModel part of the role that the PageModel plays, and how tools like AutoMapper can be used to reduce the amount of code you need to write when assigning values between your entity model and your ViewModel.

Click to read more about ViewModels and AutoMapper in Razor Pages ...

Viewed 5609 times

I'm Not Writing A Book On Razor Pages

19 January 2018 08:47

ASP.NET Core Razor Pages

That's right - despite a number of questions, I am not writing a book on Razor Pages, the new page-based web development framework released as part of ASP.NET Core 2.0. But I have launched a web site for people who want to learn how to use ASP.NET Core Razor Pages.

Click to read more about I'm Not Writing A Book On Razor Pages ...

Viewed 2309 times

Customising Identity in Razor Pages

22 September 2017 14:16

ASP.NET Core Razor Pages ASP.NET Identity

The code for managing authentication in a Razor Pages application that is provided by the standard project template is a good starting point. However, chances are that you want to customise it to fit your own application needs. This article looks at the most common customisation requirements.

Click to read more about Customising Identity in Razor Pages ...

Viewed 2296 times

Introduction to Identity in Razor Pages

08 September 2017 08:09

ASP.NET Core Razor Pages ASP.NET Identity

Razor Pages uses ASP.NET Identity as its default membership and authentication system. This article is the first in a series that explores the various parts of ASP.NET Identity as it relates to Razor Pages, and starts with an overview of the files generated as part of the project templates.

Click to read more about Introduction to Identity in Razor Pages ...

Viewed 3500 times

Sending Email in Razor Pages

20 July 2017 07:24

ASP.NET Core Razor Pages

The Razor Pages framework is not the only thing to be introduced as part of .NET Core 2.0. A lot more of the existing full framework class libraries are also being ported across to .NET Core including System.Net.Mail. That means there is no longer any need to rely on third party libraries or services for email functionality in your .NET Core applications. So I thought I'd take the opportunity to illustrate sending email in a Razor Pages application.

Click to read more about Sending Email in Razor Pages ...

Viewed 3730 times

Routing in Razor Pages

11 July 2017 13:28

ASP.NET Core Razor Pages

One of the top level design considerations for the developers of a server-side web application framework is how to match URLs to resources on the server so that the correct one processes the request. The most straightforward approach is to map URLs to physical files on disk, and this is the approach that has been implemented by the ASP.NET team for the Razor Pages framework.

Click to read more about Routing in Razor Pages ...

Viewed 8955 times

Razor Pages - The Elevator Pitch

25 May 2017 08:29

ASP.NET MVC ASP.NET Core Razor Pages

In the last ASP.NET Community Standup, Jon Galloway gave my introductory Razor Pages article a shout out (thank you, Jon). During the discussion that ensued, Scott Hanselman asked for the "elevator pitch" for Razor Pages. Well, here's mine.

Click to read more about Razor Pages - The Elevator Pitch ...

Viewed 5641 times

Razor Pages - Understanding Handler Methods

22 May 2017 20:16

ASP.NET Core Razor Pages

Handler methods is a particularly nice feature introduced with the new ASP.NET Razor Pages framework . This feature enables you to determine what the user was doing when they requested the page, and to execute logic accordingly without having to resort to a bunch of conditional code.

Click to read more about Razor Pages - Understanding Handler Methods ...

Viewed 7998 times

Razor Pages - Getting Started With The Preview

15 May 2017 20:52

Razor ASP.NET Core Razor Pages

Current users of ASP.NET Web Pages have been eagerly awaiting news on what ASP.NET Core holds for them (if my inbox is anything to go by). The roadmap suggested that a new version of Web Pages would be forthcoming after the initial release of .NET Core, but that item was subsequently removed. Instead, a new cross platform page-centric web development model called Razor Pages has been made available in preview form. Here, I show you how to get started with it and explore its similarities with Web Pages. In future articles, I will take a closer look at the wide range of differences.

Click to read more about Razor Pages - Getting Started With The Preview ...

Viewed 5483 times

Working With Zip Files In ASP.NET MVC

10 February 2017 07:41

ASP.NET MVC

Since ASP.NET 4.5, zipping and unzipping files can be done with classes from within the .NET framework. Despite that, nearly all examples that illustrate working with zip files in ASP.NET applications feature third party open source compression libraries. This short article attempts to correct that by demonstrating the use of the System.IO.Compression classes to unpack an uploaded zip file, and to create one for download in an ASP.NET MVC application.

Click to read more about Working With Zip Files In ASP.NET MVC ...

Viewed 8586 times

Free SSL Certificates On IIS With LetsEncrypt

02 February 2017 07:44

ASP.NET MVC ASP.NET Web Forms ASP.NET Core

If you have forms on your site that take a user's personal details, you should protect the page by running it under HTTPS. That way, any data that's posted from the form (email address, credit card number etc) is encrypted and hidden from prying eyes. It's not just e-commerce sites that should be protected. Intranets and other line of business apps that require authentication, blogs with comment forms that ask for email addresses and so on. The main barrier to this in the past has been the cost of the digital certificate (SSL Certificate) that asserts that you are who you say you are. LetsEncrypt is a free, automated, and open Certificate Authority that removes this barrier.

Click to read more about Free SSL Certificates On IIS With LetsEncrypt ...

Viewed 4845 times