Event not firing in datalist control

Discussion in 'ASP .Net Web Controls' started by Richard Murphy, Nov 10, 2003.

  1. I've been on this problem for many hours now and checked many posts and
    forums but can still not find an answer. I hope someone can help.

    I have a Datalist with a template column in it which contains a button. The
    datalist is in an ascx control that is loaded dynamically by the parent aspx
    control. The problem the 'itemcommand' event is no longer being fired on
    postback in response to the users click. I have tried everything. The event
    is definitely wired up - the datalist is only bound once within the
    !Page.Ispostback statement. The event was firing once before and now,
    although I have changed nothing within the code that I know, all of a sudden
    it does not. There is a possibility that something in one of the parent
    containers controls has changed that could effect it but nothing that I know
    of. I have tried creating a separate aspx page and replicating the datalist
    there - the event fires no problem in this - it just doesn't work in the
    child ascx controls. Any ideas?

    Any help would be really, really appreciated.

    Regards

    Richard Murphy
    espod.net
     
    Richard Murphy, Nov 10, 2003
    #1
    1. Advertising

  2. OK - it's solved!

    It seems a change had been made to the parent control of the control with
    the datalist in it that caused it to get loaded in the 'inializecomponent'
    function. which screwed up the viewstate for the datalist.

    "Richard Murphy" <> wrote in message
    news:...
    > I've been on this problem for many hours now and checked many posts and
    > forums but can still not find an answer. I hope someone can help.
    >
    > I have a Datalist with a template column in it which contains a button.

    The
    > datalist is in an ascx control that is loaded dynamically by the parent

    aspx
    > control. The problem the 'itemcommand' event is no longer being fired on
    > postback in response to the users click. I have tried everything. The

    event
    > is definitely wired up - the datalist is only bound once within the
    > !Page.Ispostback statement. The event was firing once before and now,
    > although I have changed nothing within the code that I know, all of a

    sudden
    > it does not. There is a possibility that something in one of the parent
    > containers controls has changed that could effect it but nothing that I

    know
    > of. I have tried creating a separate aspx page and replicating the

    datalist
    > there - the event fires no problem in this - it just doesn't work in the
    > child ascx controls. Any ideas?
    >
    > Any help would be really, really appreciated.
    >
    > Regards
    >
    > Richard Murphy
    > espod.net
    >
    >
     
    Richard Murphy, Nov 11, 2003
    #2
    1. Advertising

  3. Hello,

    I am doing something very similar and running into a problem. I am
    pulling in a datalist control from an ascx page and trying to bind
    data to it on the aspx.vb page. No matter what I do, I can't get it to
    display. I can response.write datalist.items.count and it says there
    are items in there.

    Do you have a code snippet that I could see to help me out?

    Thanks,
    Brandon
     
    Brandon Nickelson, Nov 13, 2003
    #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. Wee Bubba
    Replies:
    0
    Views:
    540
    Wee Bubba
    May 24, 2004
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,916
  3. Paul L
    Replies:
    1
    Views:
    7,329
  4. cindy
    Replies:
    0
    Views:
    423
    cindy
    Sep 9, 2008
  5. Paul L
    Replies:
    0
    Views:
    260
    Paul L
    May 5, 2005
Loading...

Share This Page