views:

469

answers:

1

I have a page with a single dropdown. Depending on what the user chooses in this dropdown, a pretty huge report is generated. The cache directive for the page reads:

<%@ OutputCache Duration="14400" VaryByParam="none" VaryByControl="lstUsers" %>

The drop-down is defined as:

<asp:DropDownList ID="lstUsers" runat="server" AutoPostBack="true" 
            onselectedindexchanged="lstUsers_SelectedIndexChanged" />

And the code-behind:

if (lstPartners.SelectedValue != "")
{
PanelChoose.Visible = false;
PanelInfo.Visible = true;

GetReport();
}

Now when I first choose an User, the report generates fine. If I go back and choose another, the first User's report is shown again...

What am I doing wrong? I'm using the .NET Framework 3.5 with Service Pack 1.

Thanks, Jim

+2  A: 

Are you using master/content pages?

OutputCache VaryByControl won't work properly for content pages.

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=465461

SolutionYogi
Ah, thanks! Guess my choices are between using `*` or no caching at all...
Jim