Click here to Skip to main content
15,117,549 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Session Pin
sashidhar8-Apr-10 3:28
Membersashidhar8-Apr-10 3:28 
GeneralRe: Session Pin
Morgs Morgan8-Apr-10 3:40
MemberMorgs Morgan8-Apr-10 3:40 
GeneralRe: Session Pin
Morgs Morgan8-Apr-10 3:41
MemberMorgs Morgan8-Apr-10 3:41 
AnswerRe: Session Pin
michaelschmitt9-Apr-10 2:14
Membermichaelschmitt9-Apr-10 2:14 
QuestionGridview with subheaders below.... Pin
pranavcool8-Apr-10 2:46
Memberpranavcool8-Apr-10 2:46 
AnswerRe: Gridview with subheaders below.... Pin
Arun Jacob8-Apr-10 2:50
MemberArun Jacob8-Apr-10 2:50 
AnswerRe: Gridview with subheaders below.... Pin
sashidhar8-Apr-10 3:14
Membersashidhar8-Apr-10 3:14 
QuestionHelp with using SqlCacheDependency programmatically? Pin
Member 43208318-Apr-10 1:58
MemberMember 43208318-Apr-10 1: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 2:32
mentorNot Active8-Apr-10 2:32 
Questioncheck session timeout Pin
alfhv7-Apr-10 23:45
Memberalfhv7-Apr-10 23:45 
AnswerRe: check session timeout Pin
Dinesh Mani8-Apr-10 0:40
MemberDinesh Mani8-Apr-10 0:40 
GeneralRe: check session timeout Pin
alfhv8-Apr-10 0:45
Memberalfhv8-Apr-10 0:45 
QuestionWindows Authentication Pin
Paul Unsworth7-Apr-10 23:39
MemberPaul Unsworth7-Apr-10 23:39 
AnswerRe: Windows Authentication Pin
Dinesh Mani8-Apr-10 0:27
MemberDinesh Mani8-Apr-10 0:27 
GeneralRe: Windows Authentication Pin
Paul Unsworth9-Apr-10 1:15
MemberPaul Unsworth9-Apr-10 1:15 
QuestionShape File Reader Pin
kjsl2k97-Apr-10 23:14
Memberkjsl2k97-Apr-10 23:14 
Questionconversion Pin
Kissy167-Apr-10 22:14
MemberKissy167-Apr-10 22:14 
AnswerRe: conversion Pin
R. Giskard Reventlov7-Apr-10 22:24
MemberR. Giskard Reventlov7-Apr-10 22:24 
GeneralRe: conversion Pin
Kissy167-Apr-10 23:06
MemberKissy167-Apr-10 23:06 
AnswerRe: conversion Pin
Dinesh Mani7-Apr-10 22:39
MemberDinesh Mani7-Apr-10 22:39 
GeneralRe: conversion Pin
Kissy167-Apr-10 23:04
MemberKissy167-Apr-10 23:04 
Questiondll resource and w3wp.exe memory leak Pin
swjam7-Apr-10 21:56
Memberswjam7-Apr-10 21:56 
Questiongridview paging problem Pin
developerit7-Apr-10 21:36
Memberdeveloperit7-Apr-10 21:36 
AnswerRe: gridview paging problem Pin
Arun Jacob7-Apr-10 21:45
MemberArun Jacob7-Apr-10 21:45 
GeneralRe: gridview paging problem Pin
developerit7-Apr-10 22:11
Memberdeveloperit7-Apr-10 22: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.