Orchard Web Developer - Microsoft ASP.NET MVC CMS

Orchard CMS Tutorials
Orchard Websites, Modules, Widgets, and Themes

  • David Hayden - Orchard Web Developer
  • Orchard CMS Developer
  • David Hayden - Orchard Samples and Tutorials
Make Layout Content Type Listable in Orchard CMS

Make Layout Content Type Listable in Orchard CMS

There is a small "bug" in Orchard.Layouts in Orchard CMS 1.9.2 that doesn't allow you to see your layouts via the Admin Dashboard after you create them. If you create a new Layout in Orchard CMS and then click the Layouts Link on the Admin Menu nothing will display. They will not display in a list ( i.e. not listable ).

read more



Null-Conditional Operator in C# 6

Null-Conditional Operator in C# 6

I've already mentioned a couple new features in C# 6: Auto-Property Initializers and String Interpolation. Another new feature introduced in C# 6 is the null-conditional operator, which helps us avoid verbose null reference checks and offers optional chaining.

read more



ASP.NET 5 Dependency Injection with Autofac

ASP.NET 5 Dependency Injection with Autofac

Earlier I wrote a blog post on ASP.NET MVC 6 Dependency Injection, which showed how to use dependency injection in ASP.NET 5 and ASP.NET MVC 6 web applications using the built-in dependency injection container. In this ASP.NET 5 Tutorial I will show how to use that same example using a more feature-rich dependency injection container called Autofac. If you are unfamiliar with dependency injection in ASP.NET 5 and ASP.NET MVC 6, please read the other tutotial first as well as the tutorial ASP.NET MVC 6 view injection.

read more



Export Dynamic Forms Data to CSV File in Orchard CMS

Export Dynamic Forms Data to CSV File in Orchard CMS

Dynamic Forms in Orchard CMS is a wonderful new feature, but using the Import Export Module to export dynamic forms data can be intimidating to clients. It feels so much more intuitive and powerful to just go to the dynamic form submissions and click on an Export to CSV Button. As an Orchard Developer I created such a button and feature, because exporting this information as a CSV file is pretty important to clients. In most cases they want to get that data as a CSV file to use in Microsoft Excel, SQL Server, or some other tool, and they want to do it easily.

read more



C# 6 String Interpolation

C# 6 String Interpolation

String Interpolation is a new feature in C# 6. It's a nice alternative to string cocatenation using "+" or string.format. One can now use expressions within strings and specify you are using string interpolation by prefixing the string with a $ symbol.

read more



ASP.NET 5 Logging using Serilog and Rolling Log File

ASP.NET 5 Logging using Serilog and Rolling Log File

I thought I would post an example of logging in ASP.NET 5 with Serilog using a Rolling Log File. You can certainly use other logging frameworks, like NLog or Log4Net, and they will work approximately the same. Microsoft.Framework.Logging is mainly an abstraction to use with logging and you can use whatever logging frameworks you want in your ASP.NET 5 and ASP.NET MVC 6 Web Applications.

read more



C# 6 Auto-Property Initializers

C# 6 Auto-Property Initializers

C# 6 includes auto-property initializers, which are a handy way to set initial property values on auto-implemented properties. Auto-property initializers are basically a shortcut to setting the property value in the constructor. I wasn't overly excited about the new feature at first, but I think it makes the intention a lot more clear when you see the initial value on the same line as the auto-implemented property.

read more



Developing Custom Form Elements for Dynamic Forms in Orchard CMS

Developing Custom Form Elements for Dynamic Forms in Orchard CMS

I had the pleasure of teaching an Orchard CMS class yesterday. One of my favorite parts of the class was showing how to extend Dynamic Forms by creating custom form elements. This is seriously fun and I demonstrated how to create a custom slider form element. There are several moving parts and it gets even more interesting when you develop custom validators and binders along with it. Developing form elements is somewhat like developing custom layout elements but a bit more involved ( see my post Develop Custom Elements for Orchard Layouts ).

read more



Dynamic Forms and Anti-Spam Elements in Orchard CMS

Dynamic Forms and Anti-Spam Elements in Orchard CMS

It's late into the night as I eagerly upgrade an old Orchard Website to Orchard 1.9.2. This upgrade is more than just an upgrade, however. From an Orchard Website perspective you could call it a complete overhaul and re-architecture. Among other things, it's using the new Dynamic Forms feature in Orchard 1.9. I almost thought I would need to create a new Form Element for Dynamic Forms, but then I found the ever so lovely Anti-Spam Elements for Dynamic Forms.

read more



ASP.NET 5 Configuration and IOptions

ASP.NET 5 Configuration and IOptions

ASP.NET 5 configuration is no longer about System.Configuration and XML configuration files like web.config. JSON seems to be the preferred file format based upon the fact that an ASP.NET 5 Web Application Template in Visual Studio 2015 uses JSON for most of its configuration information: appsettings.json, bower.json, package.json, project.json, etc. There are other built-in providers which I will mention, but in this ASP.NET 5 tutorial I want to show an example of using a JSON file for configuration and how to use it with dependency injection along with IOptions<T>.

read more