Page Control Cacheing problems

attactapanceP

New Member
Hey all, I've got a problem I'm been having troubles with and I'm hoping someone can help me out. Here it goes:<BR><BR>First, I have a page control that shows results from a poll that is currently running. Sinse calculating the result precentages is a pretty heavy job, it is cached by the minute (in the control), like this:<BR><%@ OutputCache Duration="60" VaryByParam="none" %><BR>then on the main page that displays the poll results control, I check if the poll has been closed, in which case I don't display the control, so I go like this: <BR><BR>if (CurrentPolls.IsPollClosed()) <BR> VollResponses1.Visible = false;<BR><BR>but I get errors. Any ideas?<BR><BR>Thanks, <BR>KevinWhat is the error?<BR>What type of contol is "VollResponses1" ?<BR>Post more of your code.<BR><BR>AaronOK, The first time I look at the page, It works out, but the second time, I get this: "System.NullReferenceException: Object reference not set to an instance of an object." unless the cache has expired by then, in which case it works.<BR><BR>Thanks,<BR>Kevin
 
Back
Top