<% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp4rc5.asp&srcfile=Interaction/ContentType" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
This is an example of a script that uses the <b>Response.ContentType</b> property to explicitly declare to the client browser the content-type of the response. Most simple HTML pages, as well as this sample, are assumed to be of the text/html content type. Sometimes, however, you will need to override this and force the browser to treat the file as a different type. </p>
<p>
For instance, it is possible to set the <b>Response.ContentType</b> property with the value text/plain, so that your ASP script is treated as a plain text file. Theoretically, no processing would then be done by your browser, and the entire file (minus server-side scripting) would be sent to you, HTML tags and all. It is important to note, however, that some browsers, including Internet Explorer 3.0, will automatically assume the content-type to be text/html of any file that contains an <HTML>, <HEAD>, or <BODY> tag, no matter what the content-type you explicitly set with <b>Response.ContentType</b>. </p>