Click here to Skip to main content
15,917,321 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Session Pin
sashidhar8-Apr-10 2:28
sashidhar8-Apr-10 2:28 
GeneralRe: Session Pin
Morgs Morgan8-Apr-10 2:40
Morgs Morgan8-Apr-10 2:40 
GeneralRe: Session Pin
Morgs Morgan8-Apr-10 2:41
Morgs Morgan8-Apr-10 2:41 
AnswerRe: Session Pin
michaelschmitt9-Apr-10 1:14
michaelschmitt9-Apr-10 1:14 
QuestionGridview with subheaders below.... Pin
pranavcool8-Apr-10 1:46
pranavcool8-Apr-10 1:46 
AnswerRe: Gridview with subheaders below.... Pin
Arun Jacob8-Apr-10 1:50
Arun Jacob8-Apr-10 1:50 
AnswerRe: Gridview with subheaders below.... Pin
sashidhar8-Apr-10 2:14
sashidhar8-Apr-10 2:14 
QuestionHelp with using SqlCacheDependency programmatically? Pin
Member 43208318-Apr-10 0:58
Member 43208318-Apr-10 0:58 
Hi,

I have a web page that uses the AJAX framework. Basically you choose something in a dropdown and click a button and the page is partially refreshed to show a gridview(which is inside an UpdatePanel with the trigger as the button). You choose a different option and click Go, the gridview is updated accordingly.

Now, I want to use sqlcachedependency in codebehind (since I'm not using SQLDatasource and doing it all programmatically). In my code, I have the code to populate the dropdown in Page_Load and in the Gridview_Load, I create my SQLCommand object. I found the following code and seems pretty simple:

SqlCacheDependency dependency = new SqlCacheDependency(comm);
int expire = 3;
DateTime exp = DateTime.Now.AddMinutes(expire);
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetExpires(exp);
Response.Cache.SetValidUntilExpires(true);
Response.AddCacheDependency(dependency);


But the question is, where do I put the code to ensure the DB isn't queried and data is actually retrieved from Cache??? Should I put it before or after my SQLDataAdapter.Fill in Gridview_Load? Or is it somewhere else?

Thanks in advance Smile | :)
AnswerRe: Help with using SqlCacheDependency programmatically? Pin
Not Active8-Apr-10 1:32
mentorNot Active8-Apr-10 1:32 
Questioncheck session timeout Pin
alfhv7-Apr-10 22:45
alfhv7-Apr-10 22:45 
AnswerRe: check session timeout Pin
Dinesh Mani7-Apr-10 23:40
Dinesh Mani7-Apr-10 23:40 
GeneralRe: check session timeout Pin
alfhv7-Apr-10 23:45
alfhv7-Apr-10 23:45 
QuestionWindows Authentication Pin
Paul Unsworth7-Apr-10 22:39
Paul Unsworth7-Apr-10 22:39 
AnswerRe: Windows Authentication Pin
Dinesh Mani7-Apr-10 23:27
Dinesh Mani7-Apr-10 23:27 
GeneralRe: Windows Authentication Pin
Paul Unsworth9-Apr-10 0:15
Paul Unsworth9-Apr-10 0:15 
QuestionShape File Reader Pin
kjsl2k97-Apr-10 22:14
kjsl2k97-Apr-10 22:14 
Questionconversion Pin
Kissy167-Apr-10 21:14
Kissy167-Apr-10 21:14 
AnswerRe: conversion Pin
R. Giskard Reventlov7-Apr-10 21:24
R. Giskard Reventlov7-Apr-10 21:24 
GeneralRe: conversion Pin
Kissy167-Apr-10 22:06
Kissy167-Apr-10 22:06 
AnswerRe: conversion Pin
Dinesh Mani7-Apr-10 21:39
Dinesh Mani7-Apr-10 21:39 
GeneralRe: conversion Pin
Kissy167-Apr-10 22:04
Kissy167-Apr-10 22:04 
Questiondll resource and w3wp.exe memory leak Pin
swjam7-Apr-10 20:56
swjam7-Apr-10 20:56 
Questiongridview paging problem Pin
developerit7-Apr-10 20:36
developerit7-Apr-10 20:36 
AnswerRe: gridview paging problem Pin
Arun Jacob7-Apr-10 20:45
Arun Jacob7-Apr-10 20:45 
GeneralRe: gridview paging problem Pin
developerit7-Apr-10 21:11
developerit7-Apr-10 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.