Response.OutputStream.Write

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jayesch
    New Member
    • Sep 2007
    • 3

    Response.OutputStream.Write

    Hi All,

    I have a small program that is trying to POST and XML to an ASP.net aspx web page. I am using WebRequest and WebResponse classes for communication between aspx and client program. Communication from client to aspx page has no problems and I am able to read complete XML file. To send a response back to the client ( a c# program) I create an XML file and convert it into byte stream and I use Response.Output Stream.Write() function to send message. On the client end I receive the message but it is followed by some standard HTML text (which is required for the aspx page. Can someone tell me how to exclude the HTML text from the response. Thanks a bunch in advance

    Code:
    <xml ........ > 
    <device>
    <name>foo</name>
    <make>bar</make>
    </device>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><link href="App_Themes/hilo/hilo.css" type="text/css" rel="stylesheet" /><title>
    	Detect Device
    </title><link href="App_Themes/hilo/hilo.css" type="text/css" rel="stylesheet" /></head>
    <body></body>
    </html>
    Jayesh Sharma
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    moved to .NET forum

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      After you call the Response.Output Stream.Write() (or whatever you use to send file Response.WriteF ile() ?) and after you are done with all your processing, you must call "Response.End() ;" or it will continue to execute the page and send content down.

      Comment

      Working...