can i use multiviews and views for every single thing, i can do on a aspx page?

1.1k Views Asked by At

in short what are the limitations i will experience?

using

vs08, webapplication

note

any disadvantage u can think of, or have encountered

e.g. regarding coding, postback, event handling, accessing properites of control within the view

2

There are 2 best solutions below

0
On BEST ANSWER

The two biggest issues I can think of:

1) Hidden Pages are still loaded. Asp.net will run almost the full page lifecycle on all Views in a MultiView, including the hidden views.

For me this is the biggest drawback. It means slower performance, and a risk of hidden pages throwing exceptions. If you have data controls on your views, you'll be loading a lot of redundant data.

See, eg http://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx, and How to stop a web control from loading child controls?

2) Hidden Pages generate View State

See How does the Multiview control handle its Viewstate?.

This means larger HTML sent to and from the browser, which means slower transmission. Also, ViewState errors do happen with Asp.net, and arguably a more bloated viewstate therefore makes these more likely.

2
On

You probably could, but it might not be a good idea.

Here are 3 examples where I would not use it for every thing.

  1. A page with several views, that has a menu on the left. Here I would not put the menu in the view.
  2. A page with a single view. Here it just adds complexity.
  3. If you have 50 forms you want to develop. You could do it with one page and one multview with 50 views. But if you have 5 developers working on 10 views each, you will get into trouble with everyone working on the same file.