[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

Partial Output Caching Not working with drop down list

Tim Barcz

7/18/2006 2:21:00 PM

I have a page which shows (for simplicity sake) one user control. This
user control has the following declaration

<%@ OutputCache Duration="20" VaryByControl="ddlDays"%>

Where ddlDays is a DropDownList containing a range of days. ddlDays is
populated in code by adding ListBoxItems to the Items property. There
is a datagrid on the page which should show different lists depending
on the date selected in ddlDays.

Everything works fine until I do a ctrl + f5 (in IE) AFTER a postback.
When doing this action, I get prompted by the standard "page cannot be
refreshed without resending the information". I click retry, which
display the page fine. It is the ensuing dropdownlist change that
doesn't produce expected results. When I select something, all
postback data is lost. For example, when I debug and look at ddl days
all of a sudden has 0 items and the selectedIndexChanged event never
fires (Page_Load occurs but not SelectedIndexChanged, though that is
the event that cause the postback).

Very irritating behavior. Have been looking at this for two weeks now.

I have the GetPostBackReference(this) in the page load event of the
containing page. This is not a JavaScript problem, rather a ASP.NET
problem since everything is posting back and what not. It just seems
like viewstate is lost when I do a ctrl + refresh.

The very very frustrating part is that everything works fine if I turn
off output caching (remove the declarative tag).