How to use ContentType!
This tutorial/code shows you how to use the contentType property of 'Response'. For people who never knew or didn't know how to use it.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="3">Content Type</font></strong><br> <em>Brought to you by MaKiT - http://www.makit.net/ </em></font></div> <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">The content type property of 'response' lets you tell the the browser what type of content there is.<br> I will show you two examples:</font></p> <table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FAFBDB"> <tr> <td><font size="2" face="Courier New, Courier, mono"><% @LANGUAGE = VBScript %><br> <%<br> Response.ContentType = "application/msword"<br> Response.Expires = 0<br> %><br> Hi!<br> This should be directly viewed in word through Internet Explorer.<br> It can be edited by the user and saved locally. This is very useful for<br> doing printable pages.<br> NB. Some users will get a open/save dialogue when opening the page and opening will display the file in internet explorer but through MSword. Saving will save the file as a *.doc.<br> NB. HTML tags are not interpretted (e.g <br />).<br> Code brought to you by MaKiT - http://www.makit.net/</font></td> </tr> </table> <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font><font size="2" face="Verdana, Arial, Helvetica, sans-serif">and...</font></p> <table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FAFBDB"> <tr> <td><font size="2" face="Courier New, Courier, mono"><% @LANGUAGE = VBScript %><br> <%<br> Response.ContentType = "text/plain"<br> Response.Expires = 0<br> %><br> There are a couple different responses to the plain text content type, either<br> opening the plain text in Internet Explorer or opening it in the persons default<br> ASP editor.<br> Code brought to you by MaKiT - http://www.makit.net/</font></td> </tr> </table> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">These are needed in such things as sending a picture in a database to the client<br> or creating pictures in response to a users input.The default content type is "text/html" and this doesn't need to be set as it is presumed.<br> Here is a list of popular content types (try experimenting):<br> ContentType="text/HTML"<br> ContentType="text/plain"<br> ContentType="image/GIF"<br> ContentType="image/JPEG"<br> ContentType = "application/vnd.ms-powerpoint"<br> ContentType = "application/msword"<br> ContentType = "application/vnd.ms-excel"<br> and so on...</font></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">I am just trying to show you how to use content type and not what all the properties are and how to use them etc.<br> Thanks<br> MaKiT</font></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br> </font></p>
Original Comments (3)
Recovered from Wayback Machine