473,800 Members | 2,523 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 25048
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
2924
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
1755
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
7390
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
4387
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
61915
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
3189
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
2025
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
9550
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
10501
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
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
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
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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
3
2944
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.