There is a Wizard element on the .aspx
page. Each of the pages placed in it is framed as a custom element .ascx
and there are many of these pages. When debugging, I noticed that when loading the wizard
itself, all its pages are loaded with it, including the invisible ones.
Is it possible to load only the visible page?
Maybe there are better ways to implement multi-page elements?
What works faster, fewer resources require MultiView or Wizard
?
1 answer
There is actually no particular difference between these two controls. Wizard
more customizable, allowing you to display a progress bar. While MultiView
demands its independent development.
Regarding your question about production. Both of these controlers dynamically load all their children during the development of the page cycle. Thus, during debugging, you see all the child elements and, accordingly, all your UserControl'ы
also go through a full load cycle ( Init
, Load
, etc.). However, when the server returns the page to the client (browser), only one of the steps of your Wizard
will be rendered in the html markup.
If the constant loading of your controls has a significant effect on performance, then it is wiser to add them to the page dynamically, rather than statically put in the Wizard
or MultiView
, and then actually hide them.