Home > Back-end >  How to use AutoPostback?
How to use AutoPostback?

Time:11-24

For example:

Region: <asp:ListBox ID="RegionListBox2" runat="server" DataSourceID="SqlDataSource1" DataTextField="RegionName" DataValueField="RegionName"></asp:ListBox>

        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

        Munipacility: <asp:DropDownList ID="MunipacilityDropDown" runat="server"></asp:DropDownList>

Now 1 region contains many municipalities. When i click region in the listbox i want the municipalities from that region to show on the dropdownlist. For example when i click the button it works just perfectly it shows the municipalities, but i want for it to work somehow with postback so when i click it automatically will show them.

CodePudding user response:

According to the documentation you just need to set ‘AutoPostback‘ to True.

  • Related