Archive For November 2019

What Happened To @Helpers In ASP.NET Core?

calendar_today 21 November 2019 13:11

ASP.NET Core ASP.NET Web Pages Razor Razor Pages

When you port your Razor-based application to ASP.NET Core, whether its an MVC application or a Web Pages application, you might notice that adding a @functions block to your .cshtml file works as expected, but any attempt to add a @helpers block doesn't work at all.

Improved Remote Validation in Razor Pages

calendar_today 13 November 2019 07:51

ASP.NET Core Razor Pages

Remote Validation is a technique that uses client side script to validate user input on the server without posting the entire form. Remote validation has always been possible in Razor Pages using either the RemoteAttribute, which requires an MVC controller to work, or by writing custom client-side script. One almost completely overlooked feature that was included in ASP.NET Core 3.0 was the introduction of a Razor Pages-specific validation attribute that removes this reliance on MVC controllers or custom code for remote validation.

Managing Authentication Token Expiry In WebAssembly-based Blazor

calendar_today 05 November 2019 13:50

ASP.NET Core Blazor

The Blazor WebAssembly project template doesn't feature an option to include authentication. If you want to add authentication to a WebAssembly-based Blazor application, you need to do it yourself. This article shows how to add application-wide authentication management and then to use built-in Razor components to protect the FetchData page in the standard template from unauthorised users.