ASP 101 - Active Server Pages 101 autopostback.aspx
<%@ Page Language="VB" %>
<script language="VB" runat="server">
	Sub Page_Load(Sender As Object, E As EventArgs)
		' Set the text of the label controls to reflect the
		' values entered or selected in the form.
		If myCheckBox.Checked Then
			lblCheckBox.Text = "checked"
		Else
			lblCheckBox.Text = "did not check"
		End If
		lblTextBox.Text = myTextBox.Text
		lblDropDownList.Text = myDropDownList.SelectedItem.Value
	End Sub
</script>
<html>
<head>
  <title>ASP.NET AutoPostBack Sample</title>
</head>
<body>
<form runat="server">
	<!--
	It's the AutoPostBack property that really does all
	the magic here.  Whenever a control loses focus, if
	the value of the contol has changed, the page is
	automatically resubmitted (or posted back) to the
	server so the page can process the new values.
	-->
	<asp:TextBox id="myTextBox" runat="server"
		AutoPostBack="True"
	/>
	<asp:DropDownList id="myDropDownList" runat="server"
		AutoPostBack="True"
	>
		<asp:ListItem>Item 1</asp:ListItem>
		<asp:ListItem>Item 2</asp:ListItem>
		<asp:ListItem>Item 3</asp:ListItem>
		<asp:ListItem>Item 4</asp:ListItem>
		<asp:ListItem>Item 5</asp:ListItem>
		<asp:ListItem>Item 6</asp:ListItem>
	</asp:DropDownList>
	<asp:CheckBox id="myCheckBox" runat="server"
		AutoPostBack="True"
	/>
	<p>
	You entered
	"<asp:Label id="lblTextBox" runat="server" />"
	in the text box, selected
	"<asp:Label id="lblDropDownList" runat="server" />"
	from the drop down list, and
	<asp:Label id="lblCheckBox" runat="server" />
	the checkbox.
	</p>
</form>
<hr />
<p>
Click <a href="http://www.asp101.com/samples/autopostback_aspx.asp">here</a>
to read about and download the source code.
</p>
</body>
</html>