Reputation: 565
How do you add MVC controls to umbraco?
I know in web forms you copy the aspx file into umbraco's usercontrols folder, and the control's dll file into umbraco's bin folder.
But i dont know how to do this for MVC controls.
Upvotes: 2
Views: 2609
Reputation: 2215
I would recommend reading these to get a handle on how MVC works in Umbraco:
http://shazwazza.com/post/native-mvc-support-in-umbraco-coming-very-soon/
http://umbraco.com/follow-us/blog-archive/2012/10/30/getting-started-with-mvc-in-umbraco-410.aspx
Upvotes: 1
Reputation: 6528
I think you mean one of these two:
1. Child Actions
Read this: http://our.umbraco.org/documentation/reference/Mvc/child-actions
It works in the same way as child actions in Mvc, just that your controllers need to be SurfaceControllers
2. Macro Partials
If what you need is a simple re-usable user controls, then you only need to use partials. You can create a .cshtml file inside Views/MacroPartials then create login to /umbraco and create a Macro that references that partial.
You can the render it with @Umbraco.RenderMacro("myMacro")
Upvotes: 0
Reputation: 457
In solution explorer Go to controller Folder and right click on it then add controller and write the code in it you want
Upvotes: 1