473,385 Members | 1,838 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,385 software developers and data experts.

Turning off User Controls in ASP.NET

I have built a user control that actually has 3 different sub user controls
embedded in it. Each of these sub controls displays data differently
depending on what a user selects and are tightly related to the others. The
problem I am running into is that even when I set visible to false, or even
disable the sub controls since they are not currently needed they still
execute and pull data from the database. This is going to make a major
performance hit on a production site.

How can I ensure the sub control is not active and does not execute its
code?

TIA,
Kent
Nov 21 '05 #1
2 931
Kent Ogletree wrote:
I have built a user control that actually has 3 different sub user controls
embedded in it. Each of these sub controls displays data differently
depending on what a user selects and are tightly related to the others. The
problem I am running into is that even when I set visible to false, or even
disable the sub controls since they are not currently needed they still
execute and pull data from the database. This is going to make a major
performance hit on a production site.

How can I ensure the sub control is not active and does not execute its
code?

TIA,
Kent


Wrap the code you do not want to run with a "If Me.Visible Then"

Chris
Nov 21 '05 #2
Thanks Chris, I knew I was missing something simple.

Kent
"Chris" <no@spam.com> wrote in message
news:Ow*************@tk2msftngp13.phx.gbl...

Wrap the code you do not want to run with a "If Me.Visible Then"

Chris

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kingofkolt | last post by:
Is it possible to turn on/off the scroll, caps, and num locks on a user's computer using javascript? It's somewhat hard to explain what I need this for, but if there is a way for this to be done,...
0
by: Dave Veeneman | last post by:
I couldn't find any postings on how to turn the VS.Net positioning grid on and off in the Google archives, so I'm adding this posting for future reference. The VS.Net positioning grid is...
1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: ElSchepo | last post by:
Hi, Just read http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/html/customcontrolfromusercontrol.asp on how to put User Controls (ascx) into an assembly. I made a...
3
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New...
6
by: Rain | last post by:
Hi, I noticed the other day when I was trying to optimise the traffic on a particular web page that it had significant viewstate even though I had turned it off for most of the controls. So in...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.