Question

I wish to have a home page with various "widgets" on them that display data from various controllers found in my site. I want the widgets displayed to depend on the role of the authenticated user. Since a lot of the widgets will appear on multiple views, my current approach is to have each widget represented by a view. Each role will also have its own view which is composed of multiple RenderAction calls various widget views. The homepage will call RenderAction to display the appropriate view for the authenticated user's role.

Questions:

1) Are there any performance issues with having multiple nested RenderAction calls on my homepage?

2) Is there any other approach that I should consider?

Was it helpful?

Solution

RenderAction will be a tiny bit slower than RenderPartial, for example. However, performance should be measured relative to your goals meaning that it's possible that RenderAction will be fast enough. Before attempting to optimize you should always measure.

And if you are doing database connections in those child actions it won't really matter how you render the results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top