473,654 Members | 3,239 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="cac hecontrol.aspx. cs"
AutoEventWireup ="false" Inherits="blah" %>
<%@ OutputCache duration="20" VaryByParam="dd lCountries"%>

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="dd lCountries"%> -->

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 1285
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 "ddlCountri es" 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?ddl Countries="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="cac hecontrol.aspx. cs"
AutoEventWireup ="false" Inherits="blah" %>
<%@ OutputCache duration="20" VaryByParam="dd lCountries"%>

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="dd lCountries"%> -->

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
1181
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 placeholder surrounds each individual dropdownlist as well and will be set to false if the data for the dropdownlist will not cause it to have more than one item. I create the items manually...I don't use databinding and I set both the text and the...
1
1414
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 from the table I use the Select method, but, how can I bind the (DataRow) rows to the ddl?
6
5527
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 added this function to have the value of DropDownList1
5
5634
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 the DDL. I've tested locally with exactly the same new record and it shows up fine in the DDL, so I'm wondering if perhaps the DataReader or DropDownList has some sort of maximum record/listcount limit?
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 upon SelectedIndexChanged event in the dropdownlist? thank you. -Sergey <ASP:DataGrid id="myDataGrid" runat="server"
15
3810
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 still selected. So far so good. But the very weird thing is that if I look at the source code : <option selected="selected" value="13808">DataPage6</option> <option value="13805">DataPage5</option>
2
16084
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 in my asp tag as shown here: <asp:DropDownList id="ddlTo" runat="server"
2
1724
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 value to be used in the "Value" property. I'm at a catch 22 right now though.. The SqlDataSource gets 2 field values.. "Name" and "Description".
0
1801
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 button for each row so that the the user can choose a row and the values will be added to a shopping cart. My problem is that the page loads fine and everything is showing as it should be. However, when I select a row the dropdownlist for that row...
0
8294
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2719
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 we have to send another system
2
1597
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.