473,395 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1804

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: .Net Newbie | last post by:
I am relatively new to .Net and have been coding an intranet site for my employer for a couple of months. I am currently stuck coding in a text-editor called EditPlus without access to the VS.Net...
1
by: Michał Januszczyk | last post by:
I have the following code on my aspx page <%if(user_status==1){%><ctl:state1 runat="server" id="aaa"></ctl:state1><%}else if(user_status==2){%><ctl:state2 runat="server"...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
0
by: .Net Newbie | last post by:
I am relatively new to .Net and have been coding an intranet site for my employer for a couple of months. I am currently stuck coding in a text-editor called EditPlus without access to the VS.Net...
10
by: darrel | last post by:
I have this structure: mypage.aspx (class = mypage) myusercontro.ascx On the mypage.aspx I can declare a variable: animal = "monkey" I can read this from the UC by simply doing this:...
3
by: Nick | last post by:
Hi, I am working on an eCommerce site, and the home page is split into multiple sections (user controls), whose data is provided from the database. Potentially this page will be cached, but its...
9
by: antonyliu2002 | last post by:
I want to create session objects for all web controls in a page. Right now, I am doing it in a dumb way like this (for example): Session("Session1") = ctrl1.Text Session("Session2") =...
3
by: rgparkins | last post by:
Hi This has been asked before but with no resolution so I am putting it out there again in case someone has an answer. 2 user controls with same name List.ascx but different namespace, and I...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
2
by: vcuankitdotnet | last post by:
I have one .aspx page that contains multiple user controls. Based on the form requested, I would like to loop through all of the user controls on the page and display the one requested by using the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.