What's the easiest way to get a web request into C# code?
<p>So... I've got an ASP.NET app. Let's assume I configure IIS to always point to the same file, <code>index.aspx</code>. Let's say I want to write <em>all</em> my code in C# and then return some HTML I generated in the C#. How do I do that?</p>

<p>Would I just have 1 file with 1 line of code,</p>

<pre><code>&lt;%@ Page CodeBehind="mycode.cs"
</code></pre>

<p>Is it necessary to have such a "useless" file? I can't direct the request straight into the code-behind?</p>

<p>Secondly, where are some good tutorials on code-behinds? Specifically, I see this <code>Page_Load</code> event that I guess gets called automatically? </p>

<ul>
<li>Are there other events? What are they? </li>
<li>Also, how would I access things like POST data, or the request URL?</li>
<li>How would I return a HTML response? Or a 404?</li>
</ul>

<p>I'm seeing a lot of tutorials on "inline" ASP, but I don't really care about that.</p>
