orchard cms: how to add media picker field to anew module
asp.net-mvc, orchardcms
Solution
You should take a look at MediaPickerFieldDriver.cs and MediaPicker.Edit.cshtml. They are both in Orchard.Fields. That should give you everything you need. Then again it's not entirely clear what you are trying to do. If you are just trying to add a media picker field to your content type from code, then you should do it from the migration, like this:
ContentDefinitionManager.AlterPartDefinition("Product",
builder => builder.WithField("ProductImage",
fieldBuilder => fieldBuilder
.OfType("MediaPickerField")
.WithDisplayName("Product Image")));
Update: As @ed13 points out in his answer, for more recent versions of Orchard 1.x (1.10+), the field type is `MediaLibraryPickerField` instead of `MediaPickerField`.
Problem
I am building a module for orchard cms. I would like to use the mediapiker module in my module. Through the orchard backend interface, its possible to add a moudle to a content item. What is not clear, is how to use one module in another. how do I add the mediapiker field to my razor view in visual studio?