user1384603
user1384603

Reputation: 565

How do you add .NET MVC controls to umbraco?

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

Answers (3)

Carlos Martinez T
Carlos Martinez T

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

Milind
Milind

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

Related Questions