Main | Object Cloning Using Reflection »

Your Own “Servlet” or HTML Spew Machine

So you want a quick way to spew your own html?

Create an aspx page and remove all the html and then in the code behind replace the Page_Load procedure with:

private void Page_Load(object sender, System.EventArgs e)
{
    Response.Clear();
    Response.ClearHeaders();
    Response.ContentType = "Text/HTML";
    Response.AppendHeader( "your header", "your value" );
    Response.Write( "<html><body>Your spew</body></html>" );
}

Of course you don't have to spew html.

-Mr.Phil

When I am not writing about making games, procrastinating or watching movies I'm working on a science fiction strategy game (sometimes called 4X or empire builder.) Email me questions, ideas and jokes at mrphil (at) mrphilgames . com

Comments

The comments to this entry are closed.