how can I tell if dropdownlist is really being cached?

H

Hazz

<%@ Page language="c#" Codebehind="cachecontrol.aspx.cs"
AutoEventWireup="false" Inherits="blah" %>
<%@ OutputCache duration="20" VaryByParam="ddlCountries"%>

is at the top of my .aspx page.

the dropdownlist ddlCountries is used to select a country after which a
submit button posts the form to launch a query to populate a grid.

By either observation of the browser or stepping through code and looking at
the IsPostback value in the Page_Load event, I see absolutely no change in
behavior by the app if I comment out <!--%@ OutputCache duration="20"
VaryByParam="ddlCountries"%> -->

Isn't the VaryByParam supposed to prevent a posting back to the server
whenever a new selection is made from the dropdown list?
There is no Postback done either way; with that line included or with it
commented out.

I know this is a real simple concept and mechanism but I just don't get it.
Thank you for any explanations of what VaryByParam is supposed to
accomplish.

-greg
 
G

Guest

hello Hazz

in asp.net varyByParam is use for page out put caching based on query
string. so if ur vary by param attribute has "ddlCountries" then it implies
that you are passing ddlCountries as a query string. Which means that ur
page's url is some thing like
urPage.aspx?ddlCountries="UAE" .

i believe you are assuming that you can cache ur page based on the values in
your drop down control. Which i believe is not correct, you will have to pass
a query string or parameter in post.

i hope it helps u out.

regards,
Hammad Rajjoub
http://dotnetwizards.blogspot.com
Member Speakers bureau,
INETA MEA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top