VaryByControl

  • Thread starter Thread starter Justin Dutoit
  • Start date Start date
J

Justin Dutoit

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
 
I should have added the link to MSDN which seems to agree (end of 4th
paragraph)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcachingmultipleversionsofusercontroloutput.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
 
Back
Top