James Flower

C# .NET and Web Developer

Tag: asp.net mvc

There are 4 posts with the "asp.net mvc" tag.

Supporting Multiple WS-Federation Authentication Schemes in ASP.NET Core

Posted on
5 min read

ASP.NET Core allows you to add support for multiple authentication schemes, such as social auth providers or WS-Federation. This support can be added with or without ASP.NET Identity Core. Users can then use these schemes to authenticate with your web application. While adding support for social authentication providers (such as Twitter and Facebook) is useful, sometimes applications need to support for multiple authentication schemes of the same type. An example of this would be support

Read more...

Changing Query String values in ASP.NET MVC

Posted on
2 min read

Recently I was trying to update a query string by adding or updating a parameter for URLs generated in a partial view. I found an excellent example for achieving this by setting route data here however this didn’t preserve current query string values in the URL. I’ve extended upon that code and updated it to include the query string values in the route data which will be appended to the query string in the generated URL (assuming the parameter key doesn’t match part of the route). p

Read more...

Disabling an ASP.NET MVC input control

Posted on
2 min read

I love ASP.NET MVC. It is a great framework to get web apps quickly built. However using the built in HtmlHelper methods on your views isn’t without its issues. An example of this is when trying to disable a HTML input control which has been built using HtmlHelper. You can add the “disabled” attribute which would be required by making use of one of the helper’s overloads however if you want to conditionally disable a control (based on your view model) it can result in your view’s code be

Read more...

How to allow HTML content in ASP .NET MVC

Posted on
1 min read

Sometimes in web development, you need to provide an easy-to-use editor for non-technical users to input or change content where extra styling is required such as making text bold or italic. However unless you use (or code yourself) an editor which uses some form of BBCode you’re going to come across the following error message if you’re using ASP .NET. I have seen various “fixes” to this suggested, the most frequent being turning off request validation entirely. While this will

Read more...