In PHP you post the form to different page for processing the user input.
However, in asp.net form Posts back to itself, and you do the form processing inside event handler of submit button in the code behind file.
Lets say in Default.aspx you did not specify action attribute,
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication3.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox runat="server" ID="yourTextBox"/>
<asp:Button ID="yourButton" Text="Submit" runat="server" OnClick="yourButton_Click"/>
</div>
</form>
</body>
</html>
When you view page source, action is populated as same page name.
Code Behind
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//IsPostBack false when page loads first time
if (!IsPostBack) //same as $_POST['Submit'] in PHP
{
//use this if block to initialize your controls values
yourTextBox.Text = "Please enter value";
}
}
protected void yourButton_Click(object sender, EventArgs e)
{
//obtain control values
//do form prcessing
string userInput = yourTextBox.Text;
//write your business logic here,
//redirect to next page
Response.Redirect("action.aspx");
}
}
For more detail on how to pass data among pages, have a look at this msdn link -
http://msdn.microsoft.com/en-us/library/6c3yckfw(v=vs.100).aspx
I hope this helps you.