In looking at samples of ASP.NET MVC sites, I\'m seeing quite a bit of examples with embedded logic in the views, e.g.:
<% if (customerIsAllowed)
{ %&g
As long as the logic in the view is for the presentation (you could put it in the code behind file if you don't like it in the markup file) then it is ok. In your example the code / logic is for selecting a certain view part which is ok. The presentation is allowed to have logic it doesn't need to be simply HTML.