Hello aspnet experts!
I have a design question for the more experienced developers (more than
me at least :-)).
1) I have a page in the application I'm building that displays a web
user control with a list of folders (let's call it the TREE)
2) There is another control called document list which shows the list
of documents for the selected tree folder (let's call it DOCLIST)
3) When a user clicks on a folder in TREE, the event handler for TREE
updates the DOCLIST control so it will display the list of documents in
that folder.
4) There is a third control that controls the user actions on the tree
structure (let's call that one TREECONTROLS)
5) When the user click on the TREECONTROLS, in its event handler, I am
removing DOCLIST from the page, then loading another control that deals
with the selected folder's properties (let's call it FOLDERPROPERTIES)
Everything great so far!
Now while FOLDERPROPERTIES is being displayed, the user may click on
TREE again, which will cause DOCLIST once again to show up. Since
DOCLIST does not exist, I create it again and display it from inside
the event handler.
Because it was not instantiated in Page_Load, DOCLIST this time does
not behave exactly as if it had been instantiated previously in
Page_Load obviously.
This is my design question to you:
What is the recommended way to go about this? I foresee a few more
controls that will appear and disappear in response to user actions.
I'm not sure whether to do a Response.Redirect back to the same page
passing some parameters (from the event handler method), or whether to
load all the controls on every Page_Load event and keep them hidden,
displaying them only when necessary.
I don't think there is the need to post code at this moment since it's
more of a design question.
Any ideas / suggestions are very welcome!
Thanks all!
webO