generic handler and text file

L

Lloyd Dupont

I'm trying a very simple generic handler, in fact almost the template like that:
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("some text");
}

problem is, when I access the page with IE, instead of showing me the text (and only the text) it show me this garbage:
===
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


------------------------------------------------------------------------------

Invalid at the top level of the document. Error processing resource 'http://localhost:1357/asp.net/eSellerate.ashx?UserName...

HJP5M-G47NN-7AJSD-S9K6B-K9BD4
^

===

What is all this garbage about XML?
I just want to output a very simple plain text string (the one in blue)

Also when I tried to refresh the page, the server was no queryed again, I had to change the query parameters.
I looked in tools => internet option
but didn't find where is the setting to use cache or not...
I want to test if my auto increment key is working! how do I do?
 
Joined
Aug 10, 2007
Messages
1
Reaction score
0
The handler.ashx that Visual Studio provided needs to be fixed before it will work. So change the Content Type from 'text/plain' to 'text/html'. Build, and debug again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top