Well, your view model should provide extension points. I assume that the data for the presentation contains these parts of the module and is somehow selected by the controller:
public ActionResult Search(string text)
{
var model = seachService.Search(text)
var viewmodel = new SearchViewModel(model, modulesService.GetModulesFor(model));
return View(model);
}
, , SearchViewModel -, View:
public interface IModuleSpecificViewPart
{
public IList<string> GetAdditionalLinksForUser();
public void RenderAdditionalInfo(Response response);
}
<%= Model.Results[i] %>
<% foreach (var module in Model.ModuleSpecific) { %>
<a href="<%=module.AdditionalLink%>">More</a>
<% module.RenderAdditionalInfo(Response); %>
<% } %>
.. , .GetModulesFor() SearchViewModel, - , SearchViewModel IoC.GetInstanceByType( "ModuleViewModel" + Module.GetType(). Name) - .
. , - , .
, , , ( ). , , - ! - . "", .