tags:

views:

154

answers:

3

My mind is really going to explode and I am so frustrated. I have been searching the net for 1 week now about this and I see a lot of contradiction on the subject and I don't know which method is the right one.

  • some people like in this article say use

    <%=Html.RenderUserControl("~/Gravatar/GravatarImage.ascx")%> but in comments people are raging about code behind usage and people are talking about breaking MVC Pattern and Testability.

  • in this article the guy suggests Partialrequests but again some people are talking about breaking MVC Pattern and Testability.

  • and in this article the guy is suggesting a way to create templates but it is not working anymore.

  • then there are Sub Controllers, Render Action, etc...

This is really confusing and makes me want to kill my self. I really got attached to the simplicity of MVC but it seems that creating shared Entities is some kind of rocket science; is it really that hard or am I missing something?

What I want is very clear; I have a portal site where for example

  • you are in the blog page, but on the right column you have a list of latest movies from IMDB service or what ever.
  • I want to have a login, join news letter in all pages.
  • the ability to load these modules based on certain logic or request.
  • Ability to load these small portlets or entities asynchronously (with loading Progress GIF)

Of course, these requirements don't relate to the current page view or their controller (that is the whole idea of Portal site you can mash and mix). In Web Forms you just create a damn user control drag it to the page, Master page and you are done; hell, you can even load them dynamically based on specific logic.

So please if someone can tell me how to achieve this kind of functionality without breaking Newton's or Einstein's Laws with MVC, and I think many people are like me in the same boat, so I think answers will benefit a lot of us.

+2  A: 

I think it's the best solution if you aren't mvc purist http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/ I

Tadeusz Wójcik
yeah i am leaning towards it, but hoped for better
A: 

Isn't this what partial views are for?

res2
partial view are for this when they are called from a the same page view or controller, but when you have partial views that dont belong to the same controller or page view this does not work, at least this is what i understood.
+1  A: 

The Maverick open-source Content Management System project on GitHub is a good starting point of doing this. But it is in an early preview state at the moment.

Peter Starbek