locked
Checkbox values getting cleared on tabs after postback RRS feed

  • Question

  • User1600599065 posted

    I am very new to asp.net, so please bear with me.  I have an .aspx page that has multiple tabs (ex. 6 tabs) on it (all tabs use the same .ascx).  On the .ascx (and thus every tab) is a checkboxlist:

    <asp:CheckBoxList ID="m_States" RepeatDirection="Horizontal" RepeatLayout="Table" Height="32px" runat="server" ClientIDMode="Static" AutoPostBack="true" OnClick="cancelUnloadEvent('onbeforeunload')"></asp:CheckBoxList>

    The checkboxlist has two boxes they can check (FL and CA).  Initially, only the first tab is enabled, and the user can check one or both of the states.  They can then click a button that will simply enable the second tab.  Nothing is checked on the checkboxlist when the enable the next tab.  At this point, if they perform another action on the form that causes a postback, the values they checked back on the first tab are cleared out.  It only happens after a postback.  If they check states on the first 4 tabs (without performing an action that causes a postback), and then perform an action on the 5th tab that causes a postback, then the checkboxlist values selected on all he previous 4 tabs is clear out.

    There is no code that clears the checkboxlist values, so I have no idea why it's clearing them on a postback.

    Any suggestions?

    Thx.

    Thursday, July 26, 2018 5:56 PM

All replies