Page with multiple web user controls

Discussion in 'ASP .Net' started by weboweb@hotmail.com, Jun 23, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Guest

    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, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Axel Dahmen
    Replies:
    1
    Views:
    542
    Teemu Keiski
    Nov 12, 2003
  2. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    602
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  3. Nathan Sokalski
    Replies:
    5
    Views:
    1,078
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  4. Faizan Ahmed
    Replies:
    1
    Views:
    309
    John Saunders
    Jan 4, 2005
  5. Faizan Ahmed
    Replies:
    1
    Views:
    390
    John Saunders
    Jan 4, 2005
Loading...

Share This Page