File download, specify default name
program code
Response.AddHeader("content-type","application/x-msdownload");
Response.AddHeader("Content-Disposition","attachment;filename=name of the file to be downloaded.rar");
Refresh page
program code
Response.AddHeader "REFRESH", "60;URL=newpath/newpage.asp"
is equivalent to the client-side <META> element:
program code
<META HTTP-EQUIV="REFRESH","60;URL=newpath/newpage.asp">
Page redirection
program code
Response.Status = "302 Object Moved"
Response.Addheader "Location", "newpath/newpage.asp"
is equivalent to using the Response.Redirect method:
Program code
Response.Redirect "newpath/newpage.asp"
Code
to force the browser to display a username/password dialog box
Response.Status= "401 Unauthorized"
Response.Addheader "WWW-Authenticate", "BASIC"
forces the browser to display a username/password dialog and then sends them back to the server using BASIC authentication (you will see authentication methods later in this book).
How to prevent web pages from buffering
program code
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.Addheader "pragma","no-cache"
Response.Addheader "cache-control","private"
Response.CacheControl = "no-cache"