HighTechTalks DotNet Forums  

More cache problems...

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss More cache problems... in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Vlad G
 
Posts: n/a

Default More cache problems... - 11-23-2004 , 05:09 PM






Hello all,

I have used almost all means as to prevent caching of datagrid on one of
my forms. Still, it is being cached. What am I doing wrong and why the
thing keeps caching the page? It's set up in the following manner - in
one small form user enters some value and then another form opens, that
in Page_Onload acceses the DB and pulls data relevant to value entered.
Here's what I have on my page (don't blame me, I was trying to do it all
the ways it is possible):

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="ResultGrid.aspx.vb" Inherits="Reporter.ResultGrid"
buffer="False" enableViewState="False"%>
<%@ OutputCache Duration="2" VaryByParam="none" Location="None"%>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Buffer = False
Response.Cache.SetMaxAge(CType(, System.TimeSpan))

HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCa
che)
If Not IsPostBack Then
drawPage()
End If
End Sub

Public Sub drawPage()
Dim query As String
If Cache("query") Is Nothing Then
// some DB connection code and grid drawing //
Else
Dim i As Integer = 0
Dim s As System.Collections.DictionaryEntry

'Server.Transfer("ResultGrid.aspx")
For Each s In Me.Cache
Me.Cache.Remove(s.Key.ToString)
i += 1
Next

HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.NoCa
che)
drawPage()
End If
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.