I'm pulling my hair out. I can't get this simple thing to work. I can't get the values from POST? What's the trick to reading POST values within aspx pages.
Here is the html page.
<html>
<head>
</head>
<body>
<form id="frm_post" action="default.aspx" method="POST">
<table>
<tr>
<td>
Name 2:
</td>
<td>
<input type="text" id="txtName2″" name="name2″" value="Jack" />
</td>
</tr>
<tr>
<td>
Address 2:
</td>
<td>
<input type="text" id="txtAddr2″" name="addr2″" value="Oz" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" value="Send Using Post" />
</td>
</tr>
</table>
</form>
</body>
</html>
Here is my aspx pge
protected void Page_Load(object sender, EventArgs e)
{
if (Request.HttpMethod == "POST")
{
string text = Request.Form["name2"];
Response.Output.WriteLine(text);
}
}