Re: Can I use Data Caching without a Session?
- From: Hans Kesting <news.hansdk@xxxxxxxxxxxxxxx>
- Date: Wed, 20 Aug 2008 10:42:32 +0200
on 19-8-2008, John Kotuby supposed :
Thanks Hans...
When the user clicks the XLS link, I want the page to remain in the background and the Excel file to be downloaded (or opened in Excel itself) rather than displayed in a new page. The idea is to keep the original page in the background while the user can perform multiple tasks. I can only get that to work properly (so far) using a standard hyperlink.
You can do that by setting an Http header value. In the Click handler do something like:
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition",
"attachment;filename=summary.xls"); // "save as" filename
// TODO: calculate the xls result
Response.Write(resultString);
// or Response.BinaryWrite(resultByteArray);
Response.End();
Hans Kesting
.
- Follow-Ups:
- Re: Can I use Data Caching without a Session?
- From: John Kotuby
- Re: Can I use Data Caching without a Session?
- References:
- Can I use Data Caching without a Session?
- From: John Kotuby
- Re: Can I use Data Caching without a Session?
- From: Hans Kesting
- Re: Can I use Data Caching without a Session?
- From: John Kotuby
- Can I use Data Caching without a Session?
- Prev by Date: Re: Cannot debug Javascript with VS2008 SP1 (Solved)ish
- Next by Date: RE: WebConfigurationManager.GetSection in Medium Trust
- Previous by thread: Re: Can I use Data Caching without a Session?
- Next by thread: Re: Can I use Data Caching without a Session?
- Index(es):