Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do you create a response page with no HTML in ASP.Net?

Reply
Thread Tools

How do you create a response page with no HTML in ASP.Net?

 
 
wptpro@gmail.com
Guest
Posts: n/a
 
      11-17-2005
I need to create an aspx page that returns a data string with no html
code. In ASP it would be easy by not including any HTML code and then
doing a repsonse.write "my data string". How do i do this in .net? It
seems to always include html even if I remove it from teh code behind
page.

 
Reply With Quote
 
 
 
 
Edwin Knoppert
Guest
Posts: n/a
 
      11-17-2005
Try in page_load or so:

Response.clear
Response.clearHeaders
Response.clearContent

Response.Write( "sgefddfdg" )

Response.close
Response.End


<(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) oups.com...
>I need to create an aspx page that returns a data string with no html
> code. In ASP it would be easy by not including any HTML code and then
> doing a repsonse.write "my data string". How do i do this in .net? It
> seems to always include html even if I remove it from teh code behind
> page.
>



 
Reply With Quote
 
 
 
 
Joerg Jooss
Guest
Posts: n/a
 
      11-17-2005
Edwin Knoppert wrote:

> Try in page_load or so:
>
> Response.clear
> Response.clearHeaders
> Response.clearContent
>
> Response.Write( "sgefddfdg" )
>
> Response.close
> Response.End


A HttpHandler would be a cleaner solution if all you want to do is dump
raw data back to the client.

Cheers,
--
http://www.joergjooss.de
(E-Mail Removed)
 
Reply With Quote
 
wptpro@gmail.com
Guest
Posts: n/a
 
      11-17-2005
any tips or help on how to do that would be great. I couldt ge the
example above to work. I just need to call an aspx page, do some
program logic, then return a data string. I'm replacing an http post
to a cgi app.

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      11-18-2005
If you remove all the template code, leaving a blank template, and
Response.Write anything that is not HTML, there will be no HTML in the
Response.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I need to create an aspx page that returns a data string with no html
> code. In ASP it would be easy by not including any HTML code and then
> doing a repsonse.write "my data string". How do i do this in .net? It
> seems to always include html even if I remove it from teh code behind
> page.
>



 
Reply With Quote
 
Joerg Jooss
Guest
Posts: n/a
 
      11-18-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> any tips or help on how to do that would be great. I couldt ge the
> example above to work. I just need to call an aspx page, do some
> program logic, then return a data string. I'm replacing an http post
> to a cgi app.


See
http://msdn.microsoft.com/library/de.../en-us/cpguide
/html/cpconcreatinghttphandlers.asp for an introduction to HttpHandlers.

As other users pointed out, you can use a ASP.NET page as well, but you
need to make sure that it doesn't contain any markup and you pay the
overhead of the page lifecycle at runtime.

Cheers,
--
http://www.joergjooss.de
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a page with empty response ra294 ASP .Net 11 01-04-2007 03:49 PM
problem with rendering page using 'Response.Redirect' and 'Response.OutputStream' André ASP .Net 3 12-01-2006 07:20 AM
if you have used createElement() and appendChild() on a page, how do you capture all the HTML to write to PHP? Jake Barnes Javascript 15 02-07-2006 06:31 AM
Lots of Response.Writes of HTML - How do YOU do it? TinyTim ASP General 13 08-13-2004 06:49 PM
Lots of Response.Writes of HTML - How do YOU do it? TinyTim ASP .Net 2 08-10-2004 03:22 AM



Advertisments