Interesting User control VS web form question
-
Hello all, I have a quick question. I’m working on a web application that takes the user in step-by-step data entry (a wizard like). The menus, top and left, are created as a user control. The question now is: 1- For the actual screens where the user enters the data, is it better to create each screen as a user control then include that control in a web form, or create each screen as a web form with the individual controls (text boxes, buttons, ..etc) as server controls in the web form it self. 2- What are the benefits of each approach, given that each screen will be viewed only once (not reusable) Thanks you all in advance, your opinions are highly appreciated
-
Hello all, I have a quick question. I’m working on a web application that takes the user in step-by-step data entry (a wizard like). The menus, top and left, are created as a user control. The question now is: 1- For the actual screens where the user enters the data, is it better to create each screen as a user control then include that control in a web form, or create each screen as a web form with the individual controls (text boxes, buttons, ..etc) as server controls in the web form it self. 2- What are the benefits of each approach, given that each screen will be viewed only once (not reusable) Thanks you all in advance, your opinions are highly appreciated
Personally, I like the User Control approach in this context. If your wizard had five steps, then you could use five user controls on your form, setting the Visible property of the four not in use on any given step to false. I've also done this sort of thing using your second approach - but in this case I use asp:Panel controls to represent each step - its a lot simpler to tell set the Visible property for a panel to false than to hide each of the individual controls within it.