freezegravity
asked on
How to handle webpart with multiple postbacks (screens)?
Hello,
I am creating a webpart that spans multiple screens. The 3 screens for the end user are,
1. Enter basic information
2. Confirm entered values screen. If you want to make changes, you can go back to screen 1 or move on to screen 3.
3. Success page.
Having written many two screen and one screen webparts before, I am fairly confident that I can get the controls I need rendered just fine.
What I am missing is the logic that goes from screen 1 to screen 3 while preserving all values so that screen 3 can store the values successfully in a list.
What is the best approach for doing this?
Thanks!
I am creating a webpart that spans multiple screens. The 3 screens for the end user are,
1. Enter basic information
2. Confirm entered values screen. If you want to make changes, you can go back to screen 1 or move on to screen 3.
3. Success page.
Having written many two screen and one screen webparts before, I am fairly confident that I can get the controls I need rendered just fine.
What I am missing is the logic that goes from screen 1 to screen 3 while preserving all values so that screen 3 can store the values successfully in a list.
What is the best approach for doing this?
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Create your control instances and add them to the controls collection in CreateChildControls. You can control the conditionality of their display in the Render method, or if it's going to be a lot of [memory] overhead do the conditionality in CreateChildControls so their instances are never created at all.
I wouldn't tend to add controls to the controls collection outside of there.
Further, you could alter the CSSClass property of the controls in your click events and control visibility with CSS.
I wouldn't tend to add controls to the controls collection outside of there.
Further, you could alter the CSSClass property of the controls in your click events and control visibility with CSS.
ASKER
I am not sure what you mean. Can you show by code sample?
I believe the button event handler can't do much of anything because at that point, CreateChildControls has already been executed and all controls already rendered. How do I get around this problem?
Thanks!
I believe the button event handler can't do much of anything because at that point, CreateChildControls has already been executed and all controls already rendered. How do I get around this problem?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you assist with this?
Open in new window