<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nick Armstrong: Colorado&#039;s Storytelling Small Business Marketing Expert and Funny Public Speaker &#187; HTML</title>
	<atom:link href="http://www.iamnickarmstrong.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iamnickarmstrong.com</link>
	<description>Nick Armstrong is Colorado&#039;s storytelling small business marketing expert and funny public speaker. He specializes in creating funny speeches, revamping failing social media campaigns, community building, and creative problem solving for small businesses.</description>
	<lastBuildDate>Mon, 06 Feb 2012 20:21:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Parsing an HTML form with ASP.Net</title>
		<link>http://www.iamnickarmstrong.com/2009/03/parsing-an-html-form-with-aspnet/</link>
		<comments>http://www.iamnickarmstrong.com/2009/03/parsing-an-html-form-with-aspnet/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 21:57:51 +0000</pubDate>
		<dc:creator>Nick Armstrong</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.iamnickarmstrong.com/?p=427</guid>
		<description><![CDATA[Today I went back to basics to solve a problem.  The Marketing Department needed a simple form that would e-mail whatever a user entered to an internal e-mail address.]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/striatic/2326801/" target="_blank"><img class="alignright size-full wp-image-428" style="border: 2px solid black; margin: 2px;" title="Programming Joke" src="http://www.iamnickarmstrong.com/wp-content/uploads/2009/03/programmingjoke.jpg" alt="Programming Joke" width="180" height="240" /></a>Today I went back to basics to solve a problem.  The Marketing Department needed a simple form that would e-mail whatever a user entered to an internal e-mail address.</p>
<p>Sounds simple, right?  The caviat: Marketing must be able to edit the form at any time.  And they don&#8217;t want to take the time to learn Expression Web or any other product besides Dreamweaver.  So, that meant taking their .HTML page and making it ASP.Net would be out of the question.</p>
<p>I remembered that the Request function pulls information from an http POST request, too.  I built out a simple website:<br />
<code>&lt;html&gt;<br />
</code><code> </code><code> &lt;head&gt;<br />
</code><code> </code><code> </code><code> &lt;title&gt;Test Form&lt;/title&gt;<br />
</code><code> </code><code>&lt;/head&gt;<br />
</code><code> </code><code>&lt;body&gt;<br />
</code><code> </code><code> </code><code>&lt;form action="FormHandler.aspx" method="post" name="HTMLForm"&gt;<br />
</code><code> </code><code> </code><code> </code><code> &lt;input name="txtTestText" type="text" /&gt;<br />
</code><code> </code><code> </code><code> </code><code> </code><code>&lt;input name="btnSubmit" type="submit" value="submit" /&gt;<br />
</code><code> </code><code> </code><code>&lt;/form&gt;<br />
</code><code>&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>I then built out my FormHandler.aspx with one label to test my theory.  In the Page_Load function I put this:</p>
<p><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
</code><code> </code><code>Label1.Text = Request("</code><code>txtTestText</code><code>")<br />
End Sub</code></p>
<p>Whatever you put into the text box on the HTML page is parsed on Page Load and appears as the label text on the ASP.Net page.</p>
<p><strong>Success! Nick Armstrong, you genius! Right?</strong></p>
<p><em>Well, kindof. </em></p>
<p>The rest of the code, I can&#8217;t show you, as it&#8217;s proprietary and I&#8217;d probably get sued.  There&#8217;s  an in-house XML mailer which I implemented to do the e-mailing.</p>
<p>I also suggested a few improvements to increase security.  The first &#8211; a simple ReCaptcha JS plugin for the HTML page to reduce spam.  Then, a hidden field which keys to a specific e-mail address in the .Net code depending on which value is used.  If it&#8217;s missing, no e-mail is sent.  That way, you reduce spam and prevent misuse of the mailer.</p>
<p>The hardest part was remembering the basic form HTML!</p>
<p>Anyway, it&#8217;s not optimal, but with a separate, dedicated form handler, Marketing can build out whatever the hell they want without having to mess with the back-end code.  They can build any number of pages and depending on which hidden field value is passed in, it can be parsed out however it needs to be.</p>
<p>Total time: 5 minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamnickarmstrong.com/2009/03/parsing-an-html-form-with-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

