Programming

Select List Enum Tag Helper

Select list enum tag helper. If you want to have a select list in a web page which is based on all the values in an enum then you can use the built in function “Html.GetEnumSelectList” with a tag helper. public enum PushType { Notification, Image, Action } <div class="row"> Read more…

By Shinigami, ago
Programming

HTML Checkbox Switches

HTML checkbox switches I’ve been using Switchery in various sites to make nice looking checkboxes, however whilst browsing the projects GitHub issues I spotted one post that said it was possible to replicate it’s functionality using pure CSS (though possibly at the cost of browser compatibility). This seems to work Read more…

By Shinigami, ago
Programming

Invisible reCAPTCHA

Invisible reCAPTCHA I’ve previously used the Google one click reCAPTCHA in sites but as the new invisible version is out I figured I’d have a go at getting it to work. Previously I had the one click reCAPTCHA working as below where the result populated an invisible required field validated Read more…

By Shinigami, ago
Programming

X-FRAME-OPTIONS Response Header

X-FRAME-OPTIONS Response Header I hadn’t previously realised this but MVC adds an X-FRAME-OPTIONS: SAMEORIGIN header to site page responses as part of a security measure to prevent sites running in iframes. These can be removed in ASP.NET 5 applications by modifying the relevant option in Startup.cs public void ConfigureServices(IServiceCollection services) Read more…

By Shinigami, ago
Programming

ASP.NET 5 Middleware

The ability to create your own middleware comes in pretty handy when creating MVC 6 APIs as it allows the inspection and processing of the requests/responses flowing into and out of the application. A few of the most useful ones I’ve used are below, a good guide to using middleware Read more…

By Shinigami, ago
Programming

Tag helpers in ASP.NET

Tag helpers in ASP.NET Tag helpers are a new feature in MVC 6 and are similar to the old style HTML helper methods though they have a more HTML like syntax. There’s plenty of good guides about how to use them around so I’m not going to rehash that here, Read more…

By Shinigami, ago