datagrid's itemcommand event gets fired

Discussion in 'ASP .Net Web Controls' started by Manick, Oct 24, 2005.

  1. Manick

    Manick Guest

    Can someone help me why is the following behaviour -
    0. The page has a resultsGrid(datagrid) and a submit button.
    1. On clicking any control within datagrid, resultsGrid_ItemDataBound is
    fired.
    2. User click's back button of the browser.
    3. User clicks on a submit button outside the datagrid.
    4. resultsGrid_ItemDataBound is also gets fired along with submit button
    click event handler.

    The requirement at 4. is, resultsGrid_ItemDataBound is not suppose to be
    called.
     
    Manick, Oct 24, 2005
    #1
    1. Advertising

  2. Manick

    Manick Guest

    event handler for submit button is a separate method. The surprise is both
    resultsGrid_ItemCommand and Submit1_Click are executed at step 4.

    "Alvin Bruney - ASP.NET MVP" wrote:

    > how is the event handler wired up? to which event is it mapped?
    >
    > --
    > Regards,
    > Alvin Bruney [MVP ASP.NET]
    >
    > [Shameless Author plug]
    > The Microsoft Office Web Components Black Book with .NET
    > Now Available @ www.lulu.com/owc
    > Forth-coming VSTO.NET - Wrox/Wiley 2006
    > -------------------------------------------------------
    >
    >
    >
    > "Manick" <> wrote in message
    > news:...
    > > Can someone help me why is the following behaviour -
    > > 0. The page has a resultsGrid(datagrid) and a submit button.
    > > 1. On clicking any control within datagrid, resultsGrid_ItemCommand is
    > > fired.
    > > 2. User click's back button of the browser.
    > > 3. User clicks on a submit button outside the datagrid.
    > > 4. resultsGrid_ItemCommand is also gets fired along with submit button
    > > click event handler.
    > >
    > > The requirement at 4. is, resultsGrid_ItemCommand is not suppose to be
    > > called.

    >
    >
    >
     
    Manick, Oct 25, 2005
    #2
    1. Advertising

  3. Manick

    Ben Guest

    just a thought....check your page_load and see if ur binding the
    datagrid on all page loads or only intial one(if (!page.ispostback)).


    *** Sent via Developersdex http://www.developersdex.com ***
     
    Ben, Oct 25, 2005
    #3
    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. Natty Gur
    Replies:
    0
    Views:
    590
    Natty Gur
    Jun 30, 2003
  2. Dan
    Replies:
    0
    Views:
    405
  3. K Viltersten
    Replies:
    0
    Views:
    375
    K Viltersten
    Aug 22, 2009
  4. Vishal

    ItemCommand not fired with LoadTemplate

    Vishal, Feb 22, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    132
    Vishal
    Feb 22, 2005
  5. alto

    DataGrid refreshes twice when ItemCommand fired

    alto, May 17, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    146
Loading...

Share This Page