473,503 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I tell if dropdownlist is really being cached?

<%@ 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
Nov 19 '05 #1
1 1271
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.

"Hazz" wrote:
<%@ 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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1174
by: PJ | last post by:
I have several dropdownlist controls in a placeholder on my form. Certain events will show this place holder and populate the values of the items collection of the dropdownlist controls. A...
1
1406
by: stefano mostarda | last post by:
Hi there, I have a problem. I have a table in a cached dataset. Depending on the page I need to get a specific set of rows from the table and bind them to a dropdownlist. To get the rows...
6
5507
by: Julius Fenata | last post by:
Dear all, I have created client-side scripting to trigger event onChange from code-behind, like this: DropDownList1.Attributes = "GenerateArticleID()"; At the script on Windows Form, I...
5
5627
by: dhnriverside | last post by:
Hi I'm using a DataReader to pull items into a DropDownList from an SQL database. Everything works fine, but my client has started to nice that newly added database entries aren't appearing in...
1
578
by: sergeyr3 | last post by:
Hey guys, I am new here, so i hope this works out: I have a datagrid which I populate with data from XML file. In EditItemTemplate I have a dropdownlist. How do I fire myDataGrid_UpdateCommand...
15
3789
by: sam | last post by:
Hi, I have a bound dropdownlist with an event handler OnSelectedIndexChanged. If I select a value I'm redirected to another page. I come back using the browser's back button, and the option is...
2
16067
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine...
2
1705
by: cider123 | last post by:
I have a SqlDataSource bound to a DropDownList Combo. Works just fine. I noticed 2 properties you can set in the DropDownList, 1 for the value to be displayed in the "Text" column and 1 for the...
0
1771
by: Moneypenny | last post by:
Hi there, I have a Gridview control which has a dropdownlist in every row. The dropdowns are populated dynamically from a database (so the content is different in each row. There is also a select...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.