Cached pages in ASP.NET post back to themselves

Rhumor

New Member
I have a page with output caching configured:\[code\]<%@ OutputCache VaryByParam="none" Duration="10" %>\[/code\]On that page I also have the following controls:\[code\]<asp:Label ID="lblChosen" runat="server" /><br /><asp:DropDownList ID="lstChoice" runat="server"> <asp:ListItem>One</asp:ListItem> <asp:ListItem>Two</asp:ListItem> <asp:ListItem>Three</asp:ListItem></asp:DropDownList><br /><asp:Button ID="cmdSubmit" runat="server" Text="Submit" onclick="cmdSubmit_Click" />\[/code\]Button click handler simply assigns the value from the DropDownList to the Label.Problem:When I request the page the first time I get it as expected. Now, I assumed that the page would be cached at this point and that any subsequent postbacks would be ignored. But that is not the case and the handler gets hit the first time I post back. After that, it doesn't get hit for the next 10 seconds.Why does it get hit on the first post back?
 
Back
Top