Ed Andersen

Software Developer and Architect in Japan

Category: ASP.NET MVC

  • Adding Razor cshtml view runtime re-compilation to a ASP.NET Core 5.0 app after creating it

    Adding Razor cshtml view runtime re-compilation to a ASP.NET Core 5.0 app after creating it

    Ed Andersen Avatar

    by

    in ,

    I recently came across an interesting issue where after starting a new ASP.NET Core 5.0 .NET 5 project using the “ASP.NET Core Web App (Model-View-Controller)” template did not include the ability to update .cshtml Razor files without recompiling and restarting the whole app. There is a checkbox to “Enable Razor Runtime Compilation” during project setup…

  • ASP.NET MVC Basics Part 2: ViewModel to Model Mapping and Editing

    Ed Andersen Avatar

    by

    in

    In Part 1, I walked through creating a simple form with a backing ViewModel and Validation. In Part 2, I’ll walk through creating a backing Model and Edit functionality. To start off from here, load up the code from part1: https://github.com/edandersen/mvcformtutorial/tree/part1 The final code for Part 2 will be uploaded here: https://github.com/edandersen/mvcformtutorial/tree/part2 Model Mapping flow…

  • ASP.NET MVC Basics Part 1: View Model binding

    Ed Andersen Avatar

    by

    in

    I’m going to walk through the basics of Form submission with ASP.NET MVC, showing some best practices. This set of tutorials will be useful for developers moving away from ASP.NET WebForms into ASP.NET MVC or even Rails developers curious about how we do things in .NET. You can download the code for Part 1 at:…

  • Adding a Dynamic Robots.txt file to an ASP.NET MVC site

    Ed Andersen Avatar

    by

    in

    Robots.txt is required to allow search engines to properly index your site, and more importantly not index it. If you have a public-facing staging or preliminary site that you don’t want to show up in Google results, you need to make sure that it returns the correct robots.txt with the Disallow: / line to prevent…