views:

41

answers:

2

Overview: I am looking to create a site that will centralize a lot of repetitive data input. I currently have a wizard built and I would like the Applications list to populate from a list of aspx pages or dll's located in the "forms" folder. While going through the wizard the user will select what applications they want to fill out forms for and it will populate those forms (A) as additional steps in the wizard, or (B) stack the forms on top of each other on the next step. Once they have filled out all of the forms it will verify all information and then send an email to specific users.

Implementation: I would like to be able to create a UserControl for each form and have it store all of the information needed for that particular application. I am assuming it would also need an Interface or few that will allow the UserControl and the main application to speak the same language. It should handle all of it's own validation and the form with needed information will be built directly in the UserControl also. I would like to be able to compile these dlls and drop them into the "forms" directory and have it automatically "implemented" by adding the application to the initial list and also having it display the form on the next step if selected. Once all the forms are filled out the user will follow through and send all information off.

My Thoughts: I have never worked with Interfaces but I am assuming this is a prime example for why I would need one. I figure I could send all of the results through the interface using a dictionary list and display the results in the email. I am thinking I would need an Interface for IApplication(to communicate app info), IRequestor(to communicate requestor info), and IAccessRequest(will combine both IApp and IReq to submit the complete request back to the web app).

My Questions:

1) So I would implement the interfaces on both the web app and the UserControl. The UserControl would use it to populate all the needed data and the web app would use it to process the data, Correct?

2) I would then inherit IApplication for my Application Method and build the method to utilize and fill application method up, but how do I send it over to the web app for processing?

3) How do I get my web app to populate the application list with the set Name property in my control?

4) How do I get the dropped in controls to populate in the wizard step where I want it to display the forms? Wouldn't I also have to register them some how?

5) Is there any good reading material for a project like this? I may be completely out of my mind but I am praying this is something that can be completed by someone with a skill set slightly over advanced.

6) Do you have a method of doing this that would work better? I really don't know what else to do with this.

Thanks for all the help! :D

A: 

I didn't feel like typing half a book here, so I made you a small example. The code is not very clean yet, but it should work. Solution is created in VS2010.

http://dl.dropbox.com/u/8420721/UserControlsDemo.zip

Tom Vervoort
Wow, a friend I met at code camp recommended these forums and now I see why. Fast, accurate responses!! Both of you gave me exactly what i want in different ways. I can now understand and play with the actual code to do it and also have a reliable framework to also work with. BIG THANK YOU!!!Thank you Tom for taking the time to code this sample for me, it feel it will be invaluable for what I am looking to do. Thank you again!
Tony
You're welcome :)
Tom Vervoort
Hey Tom, This is very well documented I am impressed and excited all at the same time! I have already begun integrating it into my code. I do have a question though, it seems as if the FormUserControl class is acting like an Interface, is this correct? If so why does it not have the Interface Icon? I never used one before so I am just trying to understand. Thanks!
Tony
In the example it's an abstract base class. It could be replaced with an interface, but using the abstract class has two advantages. Every object could implement the interface, but by using an abstract base class you are sure that you only have usercontrols. Another advantage is that you could implement some shared logic in the base class, which is not possible in an interface.
Tom Vervoort
Good to know, I am still trying to grasp the need for abstract and a few other modifiers so this is a good example. The project is rolling so much smoother then I thought it was going too thanks to your example. I have already modified the code to work in my environment and I am really excited about the progress. I am hoping this one will move fast so can present it to my management. I am not technically a developer at work but they have me doing project here and there. Thank you for helping me with this, I think it will help my career at my job. Thanks!!!
Tony
Hey Tom, hate to bother you again but I am having issues with this same project. I am using a wizardcontrol and dynamically adding the steps at OnInit but the control that sets the pages does not fire the method until it comes back around which is causing the wizard control to always be a step behind its intended step. Any advise on how to fix this? I created another post also to check for help. THanks! http://stackoverflow.com/questions/3831938/dynamic-control-not-showing-on-post-back
Tony
A: 

Try This

Dimestore Cowboy