.NETGURU
Loading user controls...
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreuse' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Andy Green
-- Moved from [aspngwebcontrols] to [aspngreuse] by Swoop Doggy Dogg <Click here to reveal e-mail address> --

Hello all,

I am tasked with creating a Web application for a client using ASP.NET. One
of the required features is to facilitate a modular display. I was thinking
that I would use user controls to contain data that could then be pushed
into a .aspx template. I have a main index.aspx file that contains a series
of asp:panels. Inside each panel is a user control. The panel's visible
property is set to false or true depending on variables from the URL string.
So, only the modules inside the visible panels get displayed. However, my
question is, even though the other user control modules are hidden by the
panels that are set to visible=false, are they still getting loaded by the
client that's viewing them? Also, at what point during the loading process
do user controls get loaded?

Any help will be appreciated.

Thanks,
Andy Green

Reply to this message...
 
    
Brian Boyce
Andy,

Rather than hiding (setting visible to false) the controls, why don't you
only add controls to the aspx page that are required. As in the ibuyspy
portal. From the sounds of your description, a customized portal would serve
your needs very well.

Brian

-----Original Message-----
From: Andy Green [mailto:Click here to reveal e-mail address]
Sent: 06 August 2002 03:56
To: aspngreuse
Subject: [aspngreuse] Loading user controls...

-- Moved from [aspngwebcontrols] to [aspngreuse] by Swoop Doggy Dogg
<Click here to reveal e-mail address> --

Hello all,

I am tasked with creating a Web application for a client using ASP.NET. One
of the required features is to facilitate a modular display. I was thinking
that I would use user controls to contain data that could then be pushed
into a .aspx template. I have a main index.aspx file that contains a series
of asp:panels. Inside each panel is a user control. The panel's visible
property is set to false or true depending on variables from the URL string.
So, only the modules inside the visible panels get displayed. However, my
question is, even though the other user control modules are hidden by the
panels that are set to visible=false, are they still getting loaded by the
client that's viewing them? Also, at what point during the loading process
do user controls get loaded?

Any help will be appreciated.

Thanks,
Andy Green

| [aspngreuse] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp = JOIN/QUIT

Reply to this message...
 
    
Andy Green
Well I appreciate the suggestion, but that doesn't answer my question.
Anyone else have any suggestions.

Thanks,
Andy

-----Original Message-----
From: Brian Boyce [mailto:Click here to reveal e-mail address]
Sent: Tuesday, August 06, 2002 7:34 AM
To: aspngreuse
Subject: [aspngreuse] RE: Loading user controls...

Andy,

Rather than hiding (setting visible to false) the controls, why don't you
only add controls to the aspx page that are required. As in the ibuyspy
portal. From the sounds of your description, a customized portal would serve
your needs very well.

Brian

-----Original Message-----
From: Andy Green [mailto:Click here to reveal e-mail address]
Sent: 06 August 2002 03:56
To: aspngreuse
Subject: [aspngreuse] Loading user controls...

-- Moved from [aspngwebcontrols] to [aspngreuse] by Swoop Doggy Dogg
<Click here to reveal e-mail address> --

Hello all,

I am tasked with creating a Web application for a client using ASP.NET. One
of the required features is to facilitate a modular display. I was thinking
that I would use user controls to contain data that could then be pushed
into a .aspx template. I have a main index.aspx file that contains a series
of asp:panels. Inside each panel is a user control. The panel's visible
property is set to false or true depending on variables from the URL string.
So, only the modules inside the visible panels get displayed. However, my
question is, even though the other user control modules are hidden by the
panels that are set to visible=false, are they still getting loaded by the
client that's viewing them? Also, at what point during the loading process
do user controls get loaded?

Any help will be appreciated.

Thanks,
Andy Green

| [aspngreuse] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp = JOIN/QUIT

| [aspngreuse] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp = JOIN/QUIT

Reply to this message...
 
    
Brian Bilbro (VIP)
[Original message clipped]

Yes they are still "loaded". However, no client-side code is sent to the
browser.

[Original message clipped]

When ASP.NET converts the .ASPX file to a .CS file you can see that is
creates the controls and adds them to the page's control collection on the
Pages Init event. You can see that by browsing the temporary files for
ASP.NET. This statement is only true for controls on the page itself.

Differences from the above statement:
1. Code-behinds are programmed by you
2. Controls within User Controls are created and added in that's
UserControl's Init (separate from the Pages' init)
3. Server Controls create and add controls during the CreateChildControl
methods (typically...you might find a rogue programmer or two who isn't
doing that :)

LoadingViewState and Load event occur for a control *after* it's been added
to it's parent control collection (off of the top of my head).

If you want to learn more about when events happen, I would recommend just
adding Trace.Write in all of your methods and see when they fire.

HTHs,
Brian

----- Original Message -----
From: "Andy Green" <Click here to reveal e-mail address>
To: "aspngreuse" <Click here to reveal e-mail address>
Sent: Tuesday, August 06, 2002 6:58 PM
Subject: [aspngreuse] RE: Loading user controls...

[Original message clipped]

Reply to this message...
 
 
System.Diagnostics.Trace
System.Web.UI.UserControl
System.Windows.Forms.UserControl




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification