asp.netvisual-studio-2008multiview

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


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


Solution

  • 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.