There are some conceptual problems in the code:
First
@Html.DropDownListFor(n => n.OrderTemplates, new SelectList(Model.OrderTemplates, "OrderTemplateId", "OrderTemplateName", 1), "Please select an order template")
When using DropDownListFor, the first parameter is the property in which your selected value is saved after the form is submitted. So, in your case, you must have SelectedOrderId as part of your model or something like that in order to use it like this:
@Html.DropDownListFor(n => n.SelectedOrderId, new SelectList(Model.OrderTemplates, "OrderTemplateId", "OrderTemplateName", 1), "Please select an order template")
Second
Apart from using the ViewBag, this is not the case, but there are more efficient ways (instead of putting this information in the ViewModel), there is a small error (or unexpected behavior) when the ViewBag property where you hold the SelectList has the same property name in which you put the selected value. To avoid this, simply use a different name, naming the property containing the list of elements.
Some code that I would use if I were you to avoid these problems and write better MVC code:
ViewModel:
public class MyViewModel{ public int SelectedOrderId {get; set;} public SelectList OrderTemplates {get; set;}
Controller:
public ActionResult MyAction(){ var model = new MyViewModel(); model.OrderTemplates = new SelectList(db.OrderTemplates, "OrderTemplateId", "OrderTemplateName", 1);
In your view
@Html.DropDownListFor(n => n.SelectedOrderId, Model.OrderTemplates, "Please select an order template")