IExceptionHandler allows us to globally handle exceptions in our ASP .NET 8 UI and API based apps. Here’s an example … Continue reading Return ProblemDetails from ASP.NET 8 IExceptionHandler global exception handler
Category: ASP.Net MVC
Setting Brotli compression level when using response compression in ASP.NET Core
Brotli compression can compress HTML, CSS and JS files more versus Gzip compression. If you can’t enable Brotli compression on … Continue reading Setting Brotli compression level when using response compression in ASP.NET Core
CheckBoxFor values not binding when output using foreach loop
If your outputting a list of checkboxes using CheckBoxFor from within a loop and are having problems getting the checkboxes … Continue reading CheckBoxFor values not binding when output using foreach loop
Handling multiple submit buttons in ASP.NET MVC action methods
You can have multiple non nested forms all posting to different action methods from different submit buttons, you can also … Continue reading Handling multiple submit buttons in ASP.NET MVC action methods
Viewing raw HTTP post name/value pairs sent to MVC action method
When using ASP.NET MVC sometimes after a request viewModel properties you expect to be binded and populated are not. For … Continue reading Viewing raw HTTP post name/value pairs sent to MVC action method
Adding data attributes to each option rendered by MVC DropDownListFor HTML Helper
Quite often you have a scenario whereby a parent dropdown causes another element to be updated based on what is … Continue reading Adding data attributes to each option rendered by MVC DropDownListFor HTML Helper
Posting disabled checkboxes from MVC Razor views
In ASP.Net MVC a common technique when dropdowns and textboxes are required to be disabled but their values still need … Continue reading Posting disabled checkboxes from MVC Razor views
MVC HTML helpers read from modelState before looking in the model
If you have posted back a form to an MVC action method and want to update some of the bound … Continue reading MVC HTML helpers read from modelState before looking in the model
MVC Dropdownlistfor defaulting to previously selected value when using a single SelectListItem List
Watch out for this one. If you have created a single list of SelectListItems and use this viewModel property to populate … Continue reading MVC Dropdownlistfor defaulting to previously selected value when using a single SelectListItem List
Organise ASP.MVC projects by feature by changing view location in MVC
I think it would be a safe bet to say most people stick with the default ASP.Net MVC folder structure … Continue reading Organise ASP.MVC projects by feature by changing view location in MVC
ASP.MVC 6 razor tag helpers for more designer friendly view markup
I’m really liking a lot of the ASP.NET 5 stuff which is coming down the line. Cross platform capabilities are … Continue reading ASP.MVC 6 razor tag helpers for more designer friendly view markup
404s with ASP.MVC on IIS 7.5
I was getting page not found errors yesterday when trying to deploy an ASP.Net MVC website which of course worked … Continue reading 404s with ASP.MVC on IIS 7.5