repeater ItemCommand not firing on first click

Discussion in 'ASP .Net' started by =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Oct 12, 2005.

  1. I've got a Repeater and within it a LinkButton.
    The LinkButton has an CommandName="Test"

    In the Repeater's ItemCommand event I want to check for this command name
    but the problem I'm having is that the ItemCommand event is not firing the
    first time the LinkButton is clicked. 2nd-(n)times after it's fine but the
    FIRST time it's clicked I get nothing.

    The repeater is on an ASCX control that's on a standard ASPX page.

    Thanks
    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Oct 12, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Q3VydF9DIFtNVlBd?=

    Karl Seguin Guest

    Curt:
    Are any of the related controls being dynamically added (or maybe even
    unrelated)?

    We got a somewhat similar behaviour in the past that was being caused by the
    Page.IsPostback switching from True to False 1/2 way through the page
    lifecycle (ProcessMain recalculates it a few times). You might want to
    check that it's still true by the time in gets to prerender. The page
    itself uses IsPostback to determine whether to fire off events...

    karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/
    "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    news:...
    > I've got a Repeater and within it a LinkButton.
    > The LinkButton has an CommandName="Test"
    >
    > In the Repeater's ItemCommand event I want to check for this command name
    > but the problem I'm having is that the ItemCommand event is not firing the
    > first time the LinkButton is clicked. 2nd-(n)times after it's fine but the
    > FIRST time it's clicked I get nothing.
    >
    > The repeater is on an ASCX control that's on a standard ASPX page.
    >
    > Thanks
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    >
     
    Karl Seguin, Oct 12, 2005
    #2
    1. Advertising

  3. Actually I found the issue just now...
    The user was resetting the ID of the LinkButton in the ItemDataBound event,
    thus the first click was disassociated from the event...

    Thanks though Karl... :}

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com



    "Karl Seguin" wrote:

    > Curt:
    > Are any of the related controls being dynamically added (or maybe even
    > unrelated)?
    >
    > We got a somewhat similar behaviour in the past that was being caused by the
    > Page.IsPostback switching from True to False 1/2 way through the page
    > lifecycle (ProcessMain recalculates it a few times). You might want to
    > check that it's still true by the time in gets to prerender. The page
    > itself uses IsPostback to determine whether to fire off events...
    >
    > karl
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    > "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    > news:...
    > > I've got a Repeater and within it a LinkButton.
    > > The LinkButton has an CommandName="Test"
    > >
    > > In the Repeater's ItemCommand event I want to check for this command name
    > > but the problem I'm having is that the ItemCommand event is not firing the
    > > first time the LinkButton is clicked. 2nd-(n)times after it's fine but the
    > > FIRST time it's clicked I get nothing.
    > >
    > > The repeater is on an ASCX control that's on a standard ASPX page.
    > >
    > > Thanks
    > > --
    > > Curt Christianson
    > > site: http://www.darkfalz.com
    > > blog: http://blog.darkfalz.com
    > >

    >
    >
    >
     
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Oct 12, 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. Michael

    Repeater ItemCommand not firing

    Michael, Nov 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,188
    Michael
    Nov 15, 2004
  2. =?Utf-8?B?RGVlcGVzaA==?=

    Datagrid ItemCommand Event Not Firing

    =?Utf-8?B?RGVlcGVzaA==?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,883
    =?Utf-8?B?RGVlcGVzaA==?=
    Oct 6, 2005
  3. =?Utf-8?B?ZGFuYw==?=

    DataGrid ItemCommand event not firing if not first page

    =?Utf-8?B?ZGFuYw==?=, Oct 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,179
    =?Utf-8?B?ZGFuYw==?=
    Oct 26, 2005
  4. Krushna

    Repeater ItemCommand does not fire the first time

    Krushna, Jul 29, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    193
    Krushna
    Jul 29, 2005
  5. Repeater.Itemcommand not firing

    , Dec 19, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    1,081
Loading...

Share This Page