<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - using Response.Flush() to send specific data to client</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - using Response.Flush() to send specific data to client</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Tue, 21 May 2013 03:43:01 GMT</pubDate>
	<lastBuildDate>Tue, 21 May 2013 03:43:01 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>6</c9:totalResults>
	<c9:pageCount>-6</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - using Response.Flush() to send specific data to client</title>
		<description><![CDATA[<p>Hi all!</p><p>I need to send an accepted response to the client. However, I need to send only the specific data and not all the extra html page data.</p><p>Currently my code behind looks like this:</p><p>Response.Write(&quot;&lt;CallBackResponse&gt;Accepted&lt;/CallBackResponse&gt;&quot;);<br>Response.Flush();</p><p>This however sends a response that looks like this: (I only want the portion in bold to be sent.)</p><p><strong>&lt;CallBackResponse&gt;Accepted&lt;/CallBackResponse&gt;&nbsp;</strong>&nbsp;&nbsp; &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;&nbsp;&nbsp;&nbsp; &lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&quot;&gt;&nbsp; &lt;head&gt;&lt;title&gt;&nbsp;&nbsp; Payment Approved&nbsp; &lt;/title&gt;&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;style type=&quot;text/css&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #makePayment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 247px;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; body&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; font-family : Calibri;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/style&gt;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/head&gt;&nbsp; &lt;body&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;BookSave.aspx&quot; id=&quot;form1&quot; style=&quot;width:100%; height:100%; text-align:center;&quot;&gt;&nbsp; &lt;input type=&quot;hidden&quot; name=&quot;__VIEWSTATE&quot; id=&quot;__VIEWSTATE&quot; value=&quot;/wEPDwULLTEzOTM0ODg4MzMPZBYCAgMPZBYCAgEPZBYCAgUPZBYEAgMPDxYCHgRUZXh0BRM5NDIzMTIxMjEzMTU0NjE4OTM3ZGQCCw9kFgxmD2QWAgIBD2QWAgIDDw8WAh8ABQczNjAwLjAwZGQCAQ9kFgICAQ9kFgICAQ8PFgIfAAUEVmlzYWRkAgIPZBYCAgEPZBYCAgEPDxYCHwAFD0RlcG9zaXQgUGF5bWVudGRkAgMPZBYCAgEPZBYCAgEPDxYCHwAFCk5SIHZhbiBXeWt</p><p>&nbsp;</p><p>Any ideas on how to accomplish this?</p><p>Thanks in advance!&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/e617e35d23734e708d74a14d00775718#e617e35d23734e708d74a14d00775718</link>
		<pubDate>Mon, 21 Jan 2013 07:14:30 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/e617e35d23734e708d74a14d00775718#e617e35d23734e708d74a14d00775718</guid>
		<dc:creator>Juan Venter</dc:creator>
		<slash:comments>6</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/lesmemphis/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - using Response.Flush() to send specific data to client</title>
		<description><![CDATA[<p>What happens if you put Response.End() instead of Response.Flush()?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/c3623924466b437da392a14d0079ab2c#c3623924466b437da392a14d0079ab2c</link>
		<pubDate>Mon, 21 Jan 2013 07:22:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/c3623924466b437da392a14d0079ab2c#c3623924466b437da392a14d0079ab2c</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>6</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - using Response.Flush() to send specific data to client</title>
		<description><![CDATA[<p>Hi, same data gets sent (flushed), but .End() will end the entire thread. So no code will be executed after I called .End()</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/5c3b2271999f4516a279a14d007c08b7#5c3b2271999f4516a279a14d007c08b7</link>
		<pubDate>Mon, 21 Jan 2013 07:31:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/5c3b2271999f4516a279a14d007c08b7#5c3b2271999f4516a279a14d007c08b7</guid>
		<dc:creator>Juan Venter</dc:creator>
		<slash:comments>6</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/lesmemphis/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - using Response.Flush() to send specific data to client</title>
		<description><![CDATA[<p>Try set <a href="http://msdn.microsoft.com/en-US/library/system.web.httpresponse.suppresscontent(v=vs.80).aspx" target="_blank">HttpResponse.SuppressContent</a> to <strong>true</strong>, then write your own content there.</p><p>Note that this property only has effect before Response.Flush() or&nbsp;any of the Page/Control.Render() method&nbsp;are called, so call it as early as possible, ideally at Page_Load().</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/876b8da36add45dfa506a14d0083946b#876b8da36add45dfa506a14d0083946b</link>
		<pubDate>Mon, 21 Jan 2013 07:59:04 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/876b8da36add45dfa506a14d0083946b#876b8da36add45dfa506a14d0083946b</guid>
		<dc:creator>cheong</dc:creator>
		<slash:comments>6</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/cheong/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - using Response.Flush() to send specific data to client</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/5c3b2271999f4516a279a14d007c08b7">1 day&nbsp;ago</a>, <a href="/Niners/lesmemphis">lesmemphis</a> wrote</p><p>Hi, same data gets sent (flushed), but .End() will end the entire thread. So no code will be executed after I called .End()</p><p></p></div></blockquote><p></p><p>Surely that's what you want? Once you have no more data to send to the client (i.e. after your final&nbsp;<span>&lt;CallBackResponse&gt;Accepted&lt;/CallBackResponse&gt;) you should call Response.End() which will immediately send the data you've written to Response and then get ready for the next incoming request.</span></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/5f925773031142b09291a14e012667c5#5f925773031142b09291a14e012667c5</link>
		<pubDate>Tue, 22 Jan 2013 17:51:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/5f925773031142b09291a14e012667c5#5f925773031142b09291a14e012667c5</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>6</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - using Response.Flush() to send specific data to client</title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client#ce617e35d23734e708d74a14d00775718">lesmemphis</a>: If you want to send non-HTML data, surely it's better to use a generic handler (.ashx) rather than a full web form (.aspx)? It would literally just be the following:</p><p><pre class="brush: csharp">&lt;%@ WebHandler Language=&quot;C#&quot; %&gt;
using System.Web;

public class YourHandler : IHttpHandler 
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = &quot;text/xml&quot;;
        context.Response.Write(&quot;&lt;CallbackResponse&gt;Accepted&lt;/CallbackResponse&gt;&quot;);
    }

    public bool IsReusable 
    {
        get { return false; }
    }
}
</pre></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/fb2c66fd9c844c97adc2a15000e3792f#fb2c66fd9c844c97adc2a15000e3792f</link>
		<pubDate>Thu, 24 Jan 2013 13:48:12 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/using-ResponseFlush-to-send-specific-data-to-client/fb2c66fd9c844c97adc2a15000e3792f#fb2c66fd9c844c97adc2a15000e3792f</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>6</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>