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

Home Posts Topics Members FAQ

problems with caching after the browser is shut

Hi

Not sure if this the right group or not but here it goes.

Here is a part excerpt of my code in the Page_Load Event

'Create cache if the cache object doesn't exist yet
If IsNothing(Cache.Get("dsAllResults")) Then

' Use various SelectCommand to fill the 4 SqlAdapters

' Add all tables to a single data set
dsAllResults.Tables.Add(Client)
dsAllResults.Tables.Add(Calendar)
dsAllResults.Tables.Add(Result)
dsAllResults.Tables.Add(Remedy)

' Cache Data Set for 5 minutes
Cache.Add("dsAllResults", dsAllResults,
Nothing, DateTime.MaxValue, _
System.TimeSpan.FromMinutes(intCacheTimeout), _
Caching.CacheItemPriority.Default, Nothing)
Else
dsAllResults = Cache("dsAllResults")

End If
If Not (IsPostBack) Then
' Bind the client dropdown
drpClient.Items.Clear()

If Not (drpClient.SelectedItem Is Nothing)
Then
drpClient.SelectedItem.Text = ""
drpClient.SelectedItem.Value = ""
drpClient.SelectedItem.Selected = False

End If

drpClient.DataSource = dsAllResults.Tables
("Client")
drpClient.DataValueField = "ClientID"
drpClient.DataTextField = "Name"
drpClient.DataBind()
drpClient.Items.Insert(0, "")

End If
End Sub

This all works fine and has made the page run much
faster , the problem i have is if some one has shut the
browser down and they re-open it again.

The page loads again and opens from the cache fine but
when it gets to this point things go funny.

drpClient.DataSource = dsAllResults.Tables("Client")
drpClient.DataValueField = "ClientID"
drpClient.DataTextField = "Name"
drpClient.DataBind()
drpClient.Items.Insert(0, "")

Up until drpClient.DataBind() everything is fine, as soon
as stepped over drpClient.DataBind() the drpClient
already has the following properties already set.

drpClient.SelectedItem.Text = "Client Name"
drpClient.SelectedItem.Value = "156"
drpClient.SelectedItem.Selected = True

These are always the last selected client from the drop
down even after the browser is shut.

Has anybody had anything like this before , is the
autopostback on the dropdown updating the cache in
anyway , i'm at my wits end on this.

If anybody can help it would be most appreciated.
Thanks & Regards


Neil Cooper
Nov 19 '05 #1
2 992
I think you want to be putting those values into the session and not the
cache. I think the cache is for the whole application. I would check but my
msdn search feature keeps crashing (reboot time.)
Nov 19 '05 #2
Yes, I checked and cache is almost the same as the application cache. This
means that the data will shared for all users and expires only when the
application is recycled.

"Scott Simons" wrote:
I think you want to be putting those values into the session and not the
cache. I think the cache is for the whole application. I would check but my
msdn search feature keeps crashing (reboot time.)

Nov 19 '05 #3

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

Similar topics

2
7160
by: Dave Griffiths | last post by:
Hi all Very new to JavaScript, I am trying to cache a number of images as the page loads, is there a max number of images or memory usage before the browser stops caching. My PC has 1G ram so...
7
11636
by: Matt Kruse | last post by:
This is a typical layout, but I have specific requirements. I'm trying to figure out a) if it's possible to meet the requirements and b) if so, how. +---------------+ | header |...
5
3122
by: R. Ian Lee | last post by:
I have an ASP.NET page that spawns a popup window using javascript's window.open. This works fine. It pops up, you enter some data, press save and everything saves as it should. But, if you...
13
1633
by: tshad | last post by:
How do we handle Caching in IE? It seems that my system works fine in Mozilla and Netscape when I make changes. But in IE the changes are not brought across when someone has been to the site...
12
1629
by: Ken Varn | last post by:
Is there anyway within my web application that I can have all browser caching turned off for all aspx pages sent by my IIS server? I need to have all caching off in order for certain things to...
2
8190
by: lanem | last post by:
I am working on a ASP.NET 2.0 web site that has some PDFs that users can download. I'm using an HTTP module to see if the user has permission to view the PDF before loading it. This all works...
6
1896
by: Jim Steinberger | last post by:
Hey all - my inaugural post, I have a Java web application on Tomcat 5 using pg73jdbc3.jar to connect to PostgreSQL 7.3.4 running on the same server (Red Hat Linux ). I have a Perl...
14
11846
by: rolfejr | last post by:
I am trying to display a PDF in the users browser that is pulled from a binary field in our database, and keep that PDF from caching on the client computer. I can successfully pull the PDF and...
2
1343
by: Tomasz | last post by:
Hello, i have following lines in my Page_Load: Response.Expires = -1; Response.AppendHeader("Pragma", "no-cache"); Response.Cache.SetNoStore();...
0
7199
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
7076
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
7274
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,...
1
6984
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...
0
7453
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...
0
5576
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,...
0
3162
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...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
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.