Page with multiple web user controls

W

weboweb

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
 
W

weboweb

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


Forget the part "does not behave exactly as if it had been instantiated
previously in
Page_Load" I fixed the problem.

It now works as I wanted it to, but I still would like to hear from you
as to the best way in your opinion to do it:

a) In the event handlers, kill old control and instantiate new one
b) In the event handlers, Response.redirect to the page with parameters
c) In Page_Load, load all controls that may be needed in the page and
keep them hidden, then in the event handlers hide or show the controls
as needed

Many thanks

webO
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top