I have a page with several ListBox es that have cascading filtering based on selected values โโusing AutoPostBack . The form accepts all selected values โโand generates an excel doc by inter-page posting to another ASPX. The problem is that after clicking the "Send once" button, it will constantly start postback through the page with every change of choice.
<asp:ScriptManager runat="server" /> <asp:UpdatePanel UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:ListBox ID="ParentItems" runat="server" SelectionMode="Multiple" AutoPostBack="true"></asp:ListBox> <asp:ListBox ID="ChildItems" runat="server" SelectionMode="Multiple" AutoPostBack="true"></asp:ListBox> </ContentTemplate> </asp:UpdatePanel> <asp:Button ID="Submit" runat="server" PostBackUrl="~/AnotherPageThatGeneratesAnExcelDoc.aspx" />
How do I undo the reverse crosstab from ListBox es' SelectedIndexChanged events?
Here's the event in code:
Protected Sub ParentItems_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ParentItems.SelectedIndexChanged '' do some filtering of the ChildItems ListBox '' tried these but they do not work ''Submit.Enabled = False ''Submit.PostBackUrl = String.Empty '' I also tried wrapping the button in a PlaceHolder and hiding/removing it, neither worked ''Buttons.Visible = False ''Buttons.Controls.Remove(Submit) End Sub
source share