Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an appropriate use for ASP.NET's MultiView control?

What are some scenarios where MultiView would be a good choice? The MultiView control along with its View controls simply seem to extend the notion of Panels.

Both Panels and MultiViews seem prone to abuse. If your UI concerns and biz logic concerns are properly separated, why lump views together in a single ASPX?

like image 369
Larsenal Avatar asked Oct 01 '08 17:10

Larsenal


2 Answers

I have used MultiViews as a more flexible basis for a Wizard control.

I do agree that lumping lots of views together is a code smell. In the case of a wizard there are often lots of pieces of state you want to share throughout the process. The multiview allows this state to be simply stored in the viewstate.

Most of the time I make the contents of each view a single user control that it can encapsulate the logic related to that particular step.

like image 184
Brownie Avatar answered Sep 26 '22 05:09

Brownie


I've used it in the passed to implement a simple Ajax-enabled tab interface.

Style a button to look like a tab, then set it's onClick event to switch the active view in an update panel.

like image 30
Rob Allen Avatar answered Sep 22 '22 05:09

Rob Allen