views:

29

answers:

1

I was debugging my current project (ASP.net MVC 1.0 project) and stumbled upon slightly disturbing behavour.

It seems that when the router is hunting for a referenced partial view aka

<%Html.RenderPartial("AccountListControl", ViewData["AccountList"]); %>

It cycles through it's default locations until it finds the correct spot. So it checks "Views\Shared\AccountListControl" and checks "Views\Home\AccountListControl" etc

Once it finds a match - all is good. Bad locations are identified by the web exception thrown in each case.

Is there a significant performance cost for all of these exceptions?

Should I modify the code to be more explicit?

A: 

It seems that in Release mode there are no exceptions thrown and view locations are cached so there is no need to be more explicit.

Darin Dimitrov