Response.ContentType and C#

  • Thread starter Thread starter Webgour
  • Start date Start date
W

Webgour

How do you reproduce this vbscript in C#
<%
Response.ContentType = "text/plain"
response.write "This is text type"
%>
 
Google: "HttpResponse Members"

IANA lists the 'official' HTTP Mime Types [1]
--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

[1] ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types
 
How do you reproduce this vbscript in C#
<%
Response.ContentType = "text/plain"
response.write "This is text type"
%>

Response.ContentType="text/plain";
Response.Write("This is text type");

tough! :)
 
And if it weren't for the fact that most VB developers are sloppy
and the VBScript language allows slop those same people (myself
included until I became concerned enough to care, to learn the facts,
and to become motivated to learn C#) they would know that the write
method of the response object uses parentheses but due to the slop
factor the parsers never require that they be used.

Thus, the proper way to write such a statement in VBS is also
Response.Write("This is text type").

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
 
Back
Top