using System;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string contentString = null;
string name = Request.Form.Get("name");
string birthdate = Request.Form.Get("birthdate");
string occupation = Request.Form.Get("occupation");
try
{
if (name.Length > 0)
{
contentString += "Hello " + name + ", thanks for filling out the form.<br>";
}
}
catch { }
try
{
if (birthdate.Length > 0)
{
contentString += "I see you were born " + birthdate + ".<br>";
}
}
catch { }
try
{
if (occupation.Length > 0)
{
contentString += "How do you like being a " + occupation + "?<br>";
}
}
catch { }
contentString += @"<form method='POST' action='default.aspx'>
<table>
<tr>
<td>Name</td>
<td><input name='name' value='" + name + @"'></td>
</tr><tr>
<td>Birth Date</td>
<td><input name='birthdate' value='" + birthdate + @"'></td>
</tr><tr>
<td>Occupation</td>
<td><input name='occupation' value='" + occupation + @"'></td>
</tr><tr>
<td colspan=2><input type='submit' value='Submit'></td>
</tr>
</table>
</form>";
content.InnerHtml = contentString;
}
}