ASP.NET - Load a partial from controller code

Partials are a nice way in ASP.NET of sharing mark-up across views. These are usually rendered from within view markup, but sometimes you may want to render a partial from within a controller method - for example if you want to create an HTML email but don’t want to put... [Read More]
Tags: .net

Environment-aware script tags with .Net 6

When writing .NET Core+ web applications, you will want your JavaScript files to be unminified in development, and minified when you release to production. You can use the “environment” tag helper to distinguish between the two, but this adds unnecessary noise and it’s too easy to change one and forget... [Read More]
Tags: .net