views:

21

answers:

2

Hi ,

I am looking for possible approaches to the following task.

Currently have a number of ASP.net pages which are essentially copies of one another but some contain textboxes,dropdownlists which others do not. this is because initially a number of pages were developed for a particular product and then another product came on board which had to do the same thing as the other pages i.e. get user to imput data and then save it. However now we are left with a large number of pages which essentially do the same thing and are difficult to maintain.

So what i am hoping to do is scrap the code as it is and replace with a configurable wizard. the requirement being that all the controls on the pages should be configurable as to whether they appear on the page and whether they are required fields.

Any ideas,examples,thoughts appreciated

thanks N

cheers niall

A: 

Have you considered the ASP.Net out-of-the-box Wizard control? You can use templated wizard steps to customize the content based on whatever logic you need.

womp
thanks but i dont think using the wizard control works well when you have ALOT of controls on it
NBrowne
+1  A: 

So I am not a big fan of the Wizard control. I would think that the best option would be to create a class that represents all of the configuration options possible and then to dynamically render the ASPX page at runtime based on the configuration options provided by the user. By Dynamically I mean adding the server controls to the page in the Init event as opposed to just hard coding them onto the page.

runxc1 Bret Ferrier
thanks . yeah i dont think i will go with the wizard control ive used it before and i think it starts getting very messy when you have alot of input controls,multiple pages etc. At the moment i am thinking to go with your solution or a variant on it which would be to create the pages with the controls on them and either control the setting of visibility,required field stuff by making database call or else by using factory pattern to do this. Though i think using the factory pattern makes most sense.my reason for not dynamically rendering the controls would be just layput issues etc
NBrowne