.NETGURU
Caching VaryByControl: problems getting value of child control
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcache' 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.

Charles M. Carroll (VIP)
Problem #1:
Take a look at:
http://www.learnasp.com/students/charlescarroll/sourcecode-searcheruc_cached.aspx
and run the code.

The good news is that the listbox output is cached. There are two ways to tell:
1. the trace.write =>
dblist_cached.ascx SUB Page_Load start
never gets called if caching occurs
and/or
2. System.Web.UI.StaticPartialCachingControl
appears at relevant places in the control tree

Of course selecting any list items in the cached example (for instance
select the city of Almeda) results in:

=> Object reference not set to an instance of an object. <=

whenever for example cy.choice is referred to in code.

HOWEVER to make this example WORK in the real world someone would need to
select data from the lists and we would use this data. see the working
non-cached example @
http://www.learnasp.com/students/charlescarroll/sourcecode-searcheruc.asp" target="_blank">http://www.learnasp.com/students/charlescarroll/sourcecode-searcheruc.asp

Is there any realistic way to make this VERY PRACTICAL caching example
work. Or is it beyond the scope of what fragment caching can handle? Is
there a workaround?

One possible hack is to use request("cy:thelist") WHICH WORKS to pick up
the data but that has the tightly coupled assumption that the .ascx engine
will always name its child control this way in future versions of ASP.net.

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Yannick Smits
[Original message clipped]

This hack is perhaps a little more save in the future:
string uid = e.Item.UniqueID & ":"
Request(uid + "thelist")

Sorry, now "real" solution
Yannick Smits

Reply to this message...
 
 
System.Web.UI.StaticPartialCachingControl




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