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

Create a test SFTP server on Ubuntu

I’m working on a project to create an SFTP Scheduler, and needed an SFTP server to test with. I work on Windows but have an Ubuntu virtual machine that I run through Hyper-V - and I didn’t realise how easy it was to set up a test server. For my... [Read More]
Tags: ubuntu