473,811 Members | 2,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.Conten tType and C#

How do you reproduce this vbscript in C#
<%
Response.Conten tType = "text/plain"
response.write "This is text type"
%>
Nov 16 '05 #1
3 25051
Google: "HttpRespon se 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/assi...es/media-types

"Webgour" <ol****@gsmzoo. com> wrote in message
news:#d******** ******@TK2MSFTN GP09.phx.gbl...
How do you reproduce this vbscript in C#
<%
Response.Conten tType = "text/plain"
response.write "This is text type"
%>

Nov 16 '05 #2
> How do you reproduce this vbscript in C#
<%
Response.Conten tType = "text/plain"
response.write "This is text type"
%>


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

tough! :)
Nov 16 '05 #3
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/
"Crea-Ue. Kirdar" <us****@creator ium.de> wrote in message
news:2j******** *****@uni-berlin.de...
How do you reproduce this vbscript in C#
<%
Response.Conten tType = "text/plain"
response.write "This is text type"
%>


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

tough! :)

Nov 16 '05 #4

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

Similar topics

5
4977
by: TJS | last post by:
trying to display pdf file in browser fails on this line: Response.ContentType = "application/pdf" getting an error about no declaration found for "response" what declaration is needed ???
1
2925
by: Charlie | last post by:
Hi: I'm uploading documents into a SQL Server Image field and using Response.BinaryWrite() to download or view them in the browser. Some doc types like Adobe Illustrator and Photoshop files will open correctly, but other like Word, Excel and Powerpoint are corrupt. Here is code fragment to upload: // Get file in byte array int fileLen = this.TextBoxFileToUpload.PostedFile.ContentLength;
4
2925
by: david | last post by:
I has a question: I can use Response.WriteFile to display images such as .jpg. But I can not us it to display words doc file in EI by calling Response.WriteFile("testdoc/DownloadLarge.doc"). It only shows unreadable chars. How to use it to show the doc file on webrowser? Thanks
0
1757
by: brian.fairchild | last post by:
I have a downloader page in my asp.net application that looks at a session variable to get the path to the file, checks it then downloads it using the Response object. When the "File Download" dialog comes up, if the user clicks "Save" and then opens the file, it works great. If the user clicks save and then opens the document up from their local computer it always (100%) works fine. However, if they choose "Open" instead then most of the...
6
7401
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the browser displays or offers to save the binary file instead. I would like to have the browser accept and display the revised HTML code as well as offering to open or save the attached file. This SHOULD be possible using a multipart MIME format -...
3
1580
by: ad | last post by:
I create a MemoryStream form a dataset: MemoryStream sm= new MemoryStream(); dsHealth.WriteXml(sm); I use Response.Write() to send this XML MemoryStream as file to client. What is the ContentType of Response I must set?
8
4388
by: Katie | last post by:
Hi, I am trying to set the content type and header for the response object but for some reason it doesnt set it. I tried it on dev and it worked fine but didnot on production. The difference is that dev is http and production is https. Is there any difference in setting the header and content type when doing so a http and when on a https server. Thanks for your help :)
4
61916
by: Bjorn Sagbakken | last post by:
With ASP.NET 2.0 I'm trying to display the pdf file directly in the client browser, but I only get a download dialogue box. Downloading the file works fine, but I want to view the PDF directly. I get the same response with: Response.ContentType="Application/X-unknown" which is more understandable. The Response.ContentType="Application/pdf" doesn't seem to tell the browser
2
3190
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...
2
2026
by: Nathan Sokalski | last post by:
I have an application in which I want to allow users to view certain files that are on the server, but not part of the application. To do this, I figured I would have ASP.NET read the files and send them to Response. I have done this with images by reading them into a Bitmap object and then using the following code: Response.ClearContent() Response.ContentType = "image/gif" mybitmap.Save(Response.OutputStream, ImageFormat.Gif)
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
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
10653
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
10137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5564
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...
1
4352
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3876
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3027
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.