I am reviewing some ASP.NET MVC code developed by a third party and have encountered the following markup in a View:
<div class="panel_body">
<% Html.RenderAction(((string[])Model)[0], "Customer"); %>
</div>
<!-- Some HTML omitted -->
<div class="wizard_body">
<% Html.RenderAction(((string[])Model)[0], "Journey"); %>
</div>
Can anyone tell me why such casting and array accessing would be needed on the model?
The view is not strongly-typed.
The two RenderAction
s are rendering two separate Views that are defined in two separate ASP.NET MVC projects.
Edit
This View is initiated using the following action method
public ActionResult Index()
{
return View(new []{"Search"});
}
Thus ((string[])Model)[0]
will return "Search"
.