473,626 Members | 3,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VaryByControl

Hey. Exp. folks, I need to know, does VaryByControl cache based on the user
control's properties, or on a server control inside the user control?
I've read two sources which say that
VaryByControl=" id" caches based on the properties of the user control, like

Public Property Something
Get
Set

I thought it was - if there is a server control in the user control like

<asp:textbox id="something" runat="server" />

then there is a cached version of the user control for every value entered
into the "something" textbox.

This is for exam prep, thanks for helping with a tricky Q.

Justin D
Nov 17 '05 #1
1 1878
I should have added the link to MSDN which seems to agree (end of 4th
paragraph)
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconcachingmul tipleversionsof usercontroloutp ut.asp
(pl paste the 2 bits together)

"If you set the VaryByControl attribute to MyTextBox, there will be a
version of user control output stored in the cache for every value that the
MyTextBox control receives."

Yet Transcender & MeasureUp both say that the caching is done on the
Properties of the User control, as in
Public Property Something
Get
Set
I'd appreciate it if someone could clarify the sentence on MSDN. Or maybe
they're both true ...

Thanks
Justin D
"Justin Dutoit" <an**@anon.co m> wrote in message
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hey. Exp. folks, I need to know, does VaryByControl cache based on the user control's properties, or on a server control inside the user control?
I've read two sources which say that
VaryByControl=" id" caches based on the properties of the user control, like
Public Property Something
Get
Set

I thought it was - if there is a server control in the user control like

<asp:textbox id="something" runat="server" />

then there is a cached version of the user control for every value entered
into the "something" textbox.

This is for exam prep, thanks for helping with a tricky Q.

Justin D

Nov 17 '05 #2

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

Similar topics

1
1304
by: julientuhuteru | last post by:
Hi! I'm caching multiple versions of a user control with the following directive in the ascx: <%@ OutputCache Duration="200" VaryByControl="PrgCtrlDropDown" %> "PrgCtrlDropDown" is the ID of a DropDownList. Everything seems to be working. Except when a user control is removed from the cache after 200 seconds, the SelectedIndexChanged event isn't fired. Does anybody know
1
1393
by: Stewart | last post by:
Hi all, hoping one of you may be able to throw up an idea on the following. I have an asp.net page with a drop-down and a user control inside. The user control should be cached in one way or another as it takes a lot of database work to produce. ----------------------------------------- | | | DROP DOWN V | | | | ...
6
2735
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache directive to vary its cache based on that property value? I.e., I have: <my:control runat="server" id="mcOne" Flag="One" /> <my:control runat="server" id="mcTwo" Flag="Two" />
3
3856
by: Ryan Moore | last post by:
I am trying to "tune" some user controls in ASP.NET for optimal caching. Is it possible to do a vary by param - on a Session Variable, so the page caches when a Session variable stays the same, but refreshes when the session changes? thnx
3
1631
by: Janaka | last post by:
Hi All, I'm having a problem with Page Output caching on a page that contains a DataGrid. Basically the page pulls up some data for sales information from the DB. Some of this has to be calculated on the fly when the request is made, and so I thought it would be ideal to cache the page for a set amount of time. I've placed the following at the top of my page: <%@ OutputCache Duration="160" VaryByParam="None" %> Now the problem is...
10
1463
by: BillGatesFan | last post by:
I'm trying to understand ASP.NET caching. I set the Page Output directive to VaryByParams= None and the duration = 60. Now whenever users hit my web app they can see each others data. Is there anyway to cache the page without this happening or am I using Page Output caching in the wrong situation? It's a data entry web app that I'm trying to increase the performance on.
1
1935
by: ABC | last post by:
<%@ OutputCache Duration="5" VaryByParam="none" VaryByControl="lblCustomerCode" %> I have this error when I run my application. How should I to do? Parser Error Message: The 'VaryByControl' attribute is not supported by the 'OutputCache' directive.
1
1872
by: rh | last post by:
Hi, My MasterPage contains a user control used for navigation. I have some .aspx pages that use this MasterPage and I would like to cache only the user control used for navigation. How do I go about doing so? I know that I can cache specific controls on a page by setting the VaryByControl property of the OutputCache directive. But if the control is
3
1265
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
Here is a user control on the page, how do I cache it by user? Currently I think we could put a server control for example ID:textusername in the asp.net page whose value is username, so we can utilize Output cache with varybycontrol to control the cache. Queation: If this is right direction, does this control ID:textusername need to be in the user control or just in the asp.net page? How do I check if it has been cached successfully?
0
8199
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8365
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7196
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2626
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.