[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Shah.Ujval.N@gmail.com

2/23/2010 1:51:00 PM

Hi,

I am exporting excel using below code:

Response.Clear();
Response.ClearHeaders();
Response.ClearHeaders();
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
Response.Cache.SetMaxAge(new TimeSpan(0, 0, 60));
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.ContentType = GetContentType(fileName);
Response.AddHeader("Content-Disposition", string.Format("attachment;
filename={0};", fileName));
Response.AddHeader("Content-Length", data.Length.ToString());
Response.OutputStream.Write(...
Response.Flush();

When I click on Export Excel link from my Employee detail page, It
creates stream data export to excel. Now within 60 seconds, close same
excel and again click on export excel. Now it shows message like
"xxx.xls is locked for edit".

I think this message because of SetMaxAge and SetExpires sets to 60
seconds... because If I reduce it to 5 seconds then it works fine or
if I remove SetMaxAge and SetExpires then also it works fine. but My
client wants 60 seconds as cache period and also don't want such type
of message.....

Is there any alternative?