2

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.

1
  • I think you need to be more specific on what you mean by MVC control. Regardless, in Umbraco, all 'external' interfaces are defined through the Developer > Macros section. Commented Jan 17, 2013 at 6:27

3 Answers 3

1

In solution explorer Go to controller Folder and right click on it then add controller and write the code in it you want

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

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")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.