AutoPostBack property of ListBox in

If we set AutoPostBack property of the ListBox to True, then form containing Listbox is submitted automatically whenever a new item is selected.
Note: AutoPostback property uses client side javascript , if a browser does not support javaScript or if JavaScript is disabled on the browser, then this property does not work.


The following example illustrate the effect of Autopostback proerty Of ListBox, suppose we have a ListBox control with AutoPostback (True) property and when a new item is selected, the SelectedIndexChanges event is raised that is associated with event ListBox_SelectedindexChanged, so whenever a new item is selected in ListBox, the form is submitted and the ListBox_SelectedIndexChanged subroutine is executed.

<script runat="server">
    Sub ListBox_SelectedindexChanged()
        MsgBox("Index is changed")
    End Sub
<html xmlns="">
<head id="Head1" runat="server">
    <title>AutoPostBack property of ListBox</title>
<body style="height: 410px; width: 768px">
    <form runat="server">
    <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ListBox_SelectedindexChanged">
    <asp:ListItem Text="USA" Value="1" />
    <asp:ListItem Text="India" Value="2" />
    <asp:ListItem Text="Japan" Value="3" />