How could you support external components in an ASP.NET MVC view?
What I mean? Think of it as an “every page login window” or “iGoogle.” This is material that should be located in specific places that are external to each controller / view.
One approach to this would be to add components to the view as follows:
<% foreach (var component in GetComponents()) {%>
<%= Html.RenderPartial(component.ViewName, component.ViewData)%>
<%} %>
In the example above, I'm looking for a good way to have the view and views supplied by each component controller, rather than the view controller on which they are displayed. Any completely different solution that you can offer is also of interest. Filters, WebForms, etc.
Update: . I will try to explain what I am trying to wrap myself around as an example. I will pick up the login.
In a typical webforms application, this could be a user control that retrieves the relevant data in the page lifecycle load event and updates some user interface elements. After clicking on the page, a response will be published, and we can act on the published information in the click event in the same user control.
ASP.NET MVC, , , , , , . , . , - .
, , , / .