Confusing problem with page_unload loading listbox

Discussion in 'ASP .Net' started by VB Programmer, Sep 22, 2004.

  1. I have a listbox which is filled based on the results of a user control
    (which acts as a "data filter" uc).

    Page_Load of my main aspx page runs.
    - Code is run which populates the listbox, but since the user control
    doesn't have data yet, ALL data is shown
    Page_Load of my user control runs.
    - User control "filters" are populated
    Page_Unload of my main aspx page runs.
    - Code is run which populates the listbox based on the filters

    I can trace the code and it follows this sequence, but by the time my page
    is finished running the listbox shows ALL data still. Any ideas? I DO
    clear the listbox before I populate it.

    I have a button called 'Refresh' which forces the repopulation of the
    listbox. Clicking on this button manually provides the expected results.
    In Page_Unload I'm basically calling "cmdRefresh_Click(sender, e)".

    Thanks.
    VB Programmer, Sep 22, 2004
    #1
    1. Advertising

  2. Never mind. By using the Page_PreRender event this problem is solved!

    "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    news:...
    > I have a listbox which is filled based on the results of a user control
    > (which acts as a "data filter" uc).
    >
    > Page_Load of my main aspx page runs.
    > - Code is run which populates the listbox, but since the user control
    > doesn't have data yet, ALL data is shown
    > Page_Load of my user control runs.
    > - User control "filters" are populated
    > Page_Unload of my main aspx page runs.
    > - Code is run which populates the listbox based on the filters
    >
    > I can trace the code and it follows this sequence, but by the time my page
    > is finished running the listbox shows ALL data still. Any ideas? I DO
    > clear the listbox before I populate it.
    >
    > I have a button called 'Refresh' which forces the repopulation of the
    > listbox. Clicking on this button manually provides the expected results.
    > In Page_Unload I'm basically calling "cmdRefresh_Click(sender, e)".
    >
    > Thanks.
    >
    >
    VB Programmer, Sep 22, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Scheer

    Page_Unload... always

    Robert Scheer, Jul 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,886
    Teemu Keiski
    Jul 25, 2003
  2. Heidi Hundåla

    Page_Unload event fires to early

    Heidi Hundåla, Oct 22, 2003, in forum: ASP .Net
    Replies:
    15
    Views:
    3,522
    Jeffrey Tan[MSFT]
    Nov 10, 2003
  3. Larry Morris

    Page_Unload event firing twice.

    Larry Morris, Dec 30, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,373
    bruce barker
    Dec 30, 2004
  4. =?Utf-8?B?Q2Vuaw==?=

    Page_Unload Problem in ASP.Net 2.0

    =?Utf-8?B?Q2Vuaw==?=, Mar 10, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    14,750
    =?Utf-8?B?Q2Vuaw==?=
    Apr 26, 2006
  5. Dan  Lichiardopol

    Page_Unload problem in .NET 1.1?

    Dan Lichiardopol, Dec 21, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    690
Loading...

Share This Page