468,290 Members | 1,937 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

Page with multiple web user controls

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

Jun 23 '06 #1
1 1620

we*****@hotmail.com wrote:
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

Jun 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by MichaƂ Januszczyk | last post: by
2 posts views Thread by John Lau | last post: by
10 posts views Thread by darrel | last post: by
9 posts views Thread by antonyliu2002 | last post: by
3 posts views Thread by rgparkins | last post: by
2 posts views Thread by vcuankitdotnet | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.