473,658 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.Append Header barfs

After reading KB234067, I am trying to replace this:

<META http-equiv="CACHE-CONTROL" content="NO-CACHE">
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Expires" content="0">

with corresponding Response.Append Header() calls in the code-behind, because
of the KB's admonition "Note that the use of standard HTTP headers are [sic]
much preferred over META tags...There is at least one known problem with the
Pragma HTTP-EQUIV meta tag".

But how do I do this? <%# Response.Append Header("Pragma" ,"no-cache") %>
cause the code to break with the error that there is no accessible ToString
method for the second argument. Not sure what I'm doing wrong.
Thanks
Timo
Nov 19 '05 #1
0 1159

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
360
by: Claus Pedersen | last post by:
We are building a webapplication but keep hitting a wall: The user can download files but we need to check if they are authorized to do so. We do this with a download-page and use the following code: public void ProcessRequest(HttpContext context) { context.Response.Clear(); context.Response.AppendHeader("Content-Disposition", "attachment; filename=test.txt"); context.Response.AppendHeader("Content-Length", "4");
2
1929
by: hoenes1 | last post by:
I've got an aspx-Page "SendFile.aspx" which is called by a Link on "ShowListOfFiles.aspx" and sends the file in the OnLoad Eventhandler. The filename to download is stored in a Session variable. I'm sending the file to the client in 4 KB chunks. Sending the file works fine, but when I click a link on the calling aspx-Page ("ShowListOfFiles.aspx") after the download completed, the browser window shows fragments of the recently transmitted...
2
4168
by: David Union | last post by:
Hi. I'm posting this here because I don't know exactly what the best group is. This is for an aspx page with Visual Basic as the code-behind page. I am doing very simple code... in the middle of an http request, i set a filename (with path) and do a Response.WriteFile(filenamewithpath) then Response.End(). I have tried Response.Clear() and .Flush() ahead of time.
11
26845
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as follows: private void SubmitButton_Click (object sender, System.EventArgs e) { // Set up the response to write the print file to the client Response.Clear (); Response.AppendHeader ("Content-Disposition", "filename=WebPrint.prn");
0
1977
by: Enzo | last post by:
Hello, I am trying to add items to the ServerVariables Collection for some custom processing. In the past this needed to be done with an ISAPI filter. I am told now that I can do this with a class file that implements IHTTPModule. Below is my code but I can't get it to work. I don't get any errors but I don't get any headers added to my collection either. Let me note that I have added the correct data to the web.config file and the...
3
1571
by: mamin | last post by:
Hi, Im trying to send bmp file to client using Internet Explorer 6.0. So my code is: string bmpFilePath=@"c:\1.bmp"; Response.ContentType="application/bmp"; Response.AppendHeader("","attachment; filename=\"" + bmpFilePath + "\""); Response.WriteFile(bmpFilePath);
3
10409
by: MJP | last post by:
I have a button which kicks off the generation of a report after which the file will be downloaded. The report generation can take a long time, so client side onclick event of the button also makes a <span> tag visible which contains a nice message to the user thanking them for their patience. Of course after the report has been generated and downloaded this message should be removed. However, the RegisterStartupScript isn't working...
2
3180
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. I have actually saved the file returned by IE 7 as a text file and opened it in notepad, so I have confirmed that it is indeed the page master being returned. The code is in the code behind file for the aspx page and is called directly from a...
0
3306
by: elliott | last post by:
Hello, I'm trying to use a C# IHttpModule to install a Response filter however IIS keeps removing the Content-Encoding header from the response; but all the other headers I set stay intact. So far I have tested my code on IIS 5.1, 6.0 and ASP.NET Development Server/9.0.0.0 all with the same result. Does anyone have any suggestions?
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.