<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: ASP.NET and Its Discontents</title>
	<atom:link href="http://www.alterzone.net/blog/2007/12/14/aspnet-and-its-discontents-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alterzone.net/blog/2007/12/14/aspnet-and-its-discontents-3/</link>
	<description>Where the Future Never Looks the Same Way Twice</description>
	<pubDate>Sat, 11 Oct 2008 05:28:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Matt</title>
		<link>http://www.alterzone.net/blog/2007/12/14/aspnet-and-its-discontents-3/#comment-3908</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 10 Jan 2008 20:19:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.alterzone.net/blog/2007/12/14/aspnet-and-its-discontents-3/#comment-3908</guid>
		<description>&lt;p&gt;I was looking for the answer to a different iTunes U problem I'm having when I found this post. I figured I would lend a helping hand.&lt;/p&gt;

&lt;p&gt;In order to have ASP.NET display the response HTML that you get back from iTunes U directly to the user (browser), you have to change a few properties in the Page's Response object. Here is an example.&lt;/p&gt;

&lt;p&gt;public void Page_Load(object sender, EventArgs e) {
    string iTunesUHtml = InvokeITunesUAction(); // simplified function call&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Response.BufferedOutput = true;
Response.Clear();
Response.Write(iTunesUHtml);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;You can also setup a generic handler in ASP.NET 2.0 or later. I use this approach and have iTunes U refer to my iTunesU.ashx handler instead. With this approach, you verify if the user is already authenticated. If not, redirect them to a login page, which then redirects back to the handler after authenticating. Your handler can then lookup the necessary credentials and issue the request to iTunes U. Afterwards, you simply write out the HTML you get back from iTunes U. With a handler, you'll just make sure to set context.Response.ContentType = "text/html".&lt;/p&gt;

&lt;p&gt;Either approach should work. If your Response.Write in the first example is not working with buffered output enabled, you may have some other HttpModule or HttpHandler installed that is messing with every single request (.aspx page).&lt;/p&gt;

&lt;p&gt;Let me know if you need more info. and good luck!&lt;/p&gt;

&lt;p&gt;-Matt&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I was looking for the answer to a different iTunes U problem I&#8217;m having when I found this post. I figured I would lend a helping hand.</p>

<p>In order to have ASP.NET display the response HTML that you get back from iTunes U directly to the user (browser), you have to change a few properties in the Page&#8217;s Response object. Here is an example.</p>

<p>public void Page_Load(object sender, EventArgs e) {
    string iTunesUHtml = InvokeITunesUAction(); // simplified function call</p>

<pre><code>Response.BufferedOutput = true;
Response.Clear();
Response.Write(iTunesUHtml);
</code></pre>

<p>}</p>

<p>You can also setup a generic handler in ASP.NET 2.0 or later. I use this approach and have iTunes U refer to my iTunesU.ashx handler instead. With this approach, you verify if the user is already authenticated. If not, redirect them to a login page, which then redirects back to the handler after authenticating. Your handler can then lookup the necessary credentials and issue the request to iTunes U. Afterwards, you simply write out the HTML you get back from iTunes U. With a handler, you&#8217;ll just make sure to set context.Response.ContentType = &#8220;text/html&#8221;.</p>

<p>Either approach should work. If your Response.Write in the first example is not working with buffered output enabled, you may have some other HttpModule or HttpHandler installed that is messing with every single request (.aspx page).</p>

<p>Let me know if you need more info. and good luck!</p>

<p>-Matt</p>]]></content:encoded>
	</item>
</channel>
</rss>
