This project is read-only.

How Orchard seperate MVC 3 Razor Project to Assembly

Topics: General
Jun 8, 2011 at 4:11 AM

I am using MvcContrib Portables Area to Register Module in MVC 3 Razor. I read the Orchard Source Code, but I don't smart enough to find out orchard 's libraries to register Module into Assembly.

And How all Module Access Orchard.jQuery to take script or css file.

Could you help me ?

Thanks !

Jun 8, 2011 at 10:34 AM

I'm not clear from your question exactly what you're trying to do. An Orchard module just needs to be in ~/Modules, and it will be found automatically. The Module.txt contains all the information required for your feature to appear in Dashboard where you can enable it. You can implement pretty much any of Orchard's interfaces and they'll automatically be used. Look at built-in modules for examples of how to do things.

To ensure jQuery is included, just write @Script.Require("jQuery") in your view.

Jun 9, 2011 at 5:25 AM

hi randompete, I see in Orchard Source Code, in folder modules, I see many project with razor view, controller. My exactly question is how Orchard is register Razor Views, Controller in seperate projects !

Jun 9, 2011 at 5:26 AM


Jun 9, 2011 at 5:34 AM

I know MVC Areas, but how you seperate this Areas to Assembly Project

in this post, which use mvccontrib portable areas to seperate areas into many projects. How Orchard do it with razor view, I see so many blog post MVC razor view have to use RazorClassGenerator in seperate projects.


Thanks !

Jun 9, 2011 at 5:44 AM

Not sure what you mean. What makes you think they are in separate projects? Well, what makes you think it's a project that compiles them?

Jun 9, 2011 at 8:57 AM

Sorry for my poor knowledge, If modules of Orchard is not compiles, Could you explain me more about how to organizate each of module with views, controllers.

How can you register the path of it ?

Thanks you for your quick reply. It's very helpful.

Jun 9, 2011 at 9:04 AM

No no no, both the views and cs files get compiled but views do not get compiled as part of a project, only cs files do. You don't need to do anything special for your views to get picked up and compiled.

Jun 9, 2011 at 10:24 AM

lovedota - Orchard modules are MVC areas, and they get picked up automatically so long as they're in the Modules folder. You don't need to register them.