views:

972

answers:

3

Hallo, my team and I are about to start a project, and we would really like to use ASP.NET MVC, not the Web Forms. Why? Nothing special, just we want to learn it well and to measure what would be better to use in future projects.

But, our project has important request. We need ability to dynamically load user controls, that can be created and uploaded in runtime. With ASP.NET Web Forms and it's LoadControl method it's simple.

Can we do something like that with MVC?

Tnx

+2  A: 

Partial views are what you want.

http://stackoverflow.com/questions/1255038/mvc-dynamically-loading-partial-views

mgroves
Ok, this is what I wanted. For the rest, I just need to learn more about MVC. Thanks a lot!
Misha N.
A: 

partial views will do the trick.. or you might want to rethink why you are using a user control. is this a third party control? could this be rewritten?

ooo
This user control can be developed separately using the SDK we should provide.
Misha N.
so it can interact with the system using SDK, and it need to get back some information back. With ASP.NET Web Forms UserControls would need to implement some interface.
Misha N.
A: 

You can use

`<%

foreach (var thing in things)

    Html.RenderPartial("location/page.ascx",thing);

%>

` from within your view

Jon Spokes