Controls inside EditTemplate cause editing to end

Discussion in 'ASP .Net Building Controls' started by Nathan Sokalski, Sep 7, 2005.

  1. I have a DataList control with an EditTemplate. Three of the controls in
    this template include a Calendar, a Button with CommandName="update", and a
    Button with CommandName="cancel". Whenever I click one of these controls,
    the DataList replaces the EditTemplate with the ItemTemplate. I think this
    is because the method I wrote which performs the databinding is getting
    called, but I don't know why or where it is getting called from. It does not
    get called from my Page_Load method and I do not have an ItemCommand event
    handler, so I don't know where to start testing for it. I tested to see if
    my UpdateCommand event is getting called when I click the Button with
    CommandName="update" by assigning some text to a Label control, so I know
    that it is never getting called. What could be causing my problem? Any help
    would be appreciated. Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
     
    Nathan Sokalski, Sep 7, 2005
    #1
    1. Advertising

  2. Nathan Sokalski

    Brock Allen Guest

    It's called from the Button's OnCommand event handler. The OnCommand is bubbled
    up thru the part control hierarchy so child controls like the button can
    send commands up to parent controls.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I have a DataList control with an EditTemplate. Three of the controls
    > in this template include a Calendar, a Button with
    > CommandName="update", and a Button with CommandName="cancel". Whenever
    > I click one of these controls, the DataList replaces the EditTemplate
    > with the ItemTemplate. I think this is because the method I wrote
    > which performs the databinding is getting called, but I don't know why
    > or where it is getting called from. It does not get called from my
    > Page_Load method and I do not have an ItemCommand event handler, so I
    > don't know where to start testing for it. I tested to see if my
    > UpdateCommand event is getting called when I click the Button with
    > CommandName="update" by assigning some text to a Label control, so I
    > know that it is never getting called. What could be causing my
    > problem? Any help would be appreciated. Thanks.
    >
     
    Brock Allen, Sep 7, 2005
    #2
    1. Advertising

  3. If that were true, why was my test code of assigning some text to a Label
    not being called? Also, that still does not explain why the Calendar was
    doing what it was doing. Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Brock Allen" <> wrote in message
    news:...
    > It's called from the Button's OnCommand event handler. The OnCommand is
    > bubbled up thru the part control hierarchy so child controls like the
    > button can send commands up to parent controls.
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    >> I have a DataList control with an EditTemplate. Three of the controls
    >> in this template include a Calendar, a Button with
    >> CommandName="update", and a Button with CommandName="cancel". Whenever
    >> I click one of these controls, the DataList replaces the EditTemplate
    >> with the ItemTemplate. I think this is because the method I wrote
    >> which performs the databinding is getting called, but I don't know why
    >> or where it is getting called from. It does not get called from my
    >> Page_Load method and I do not have an ItemCommand event handler, so I
    >> don't know where to start testing for it. I tested to see if my
    >> UpdateCommand event is getting called when I click the Button with
    >> CommandName="update" by assigning some text to a Label control, so I
    >> know that it is never getting called. What could be causing my
    >> problem? Any help would be appreciated. Thanks.
    >>

    >
    >
    >
     
    Nathan Sokalski, Sep 7, 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. Nathan Sokalski

    Controls inside EditTemplate cause editing to end

    Nathan Sokalski, Sep 7, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    581
    Nathan Sokalski
    Sep 9, 2005
  2. Aamir Ghanchi
    Replies:
    1
    Views:
    497
    Aamir Ghanchi
    Oct 2, 2007
  3. Savvoulidis Iordanis
    Replies:
    0
    Views:
    307
    Savvoulidis Iordanis
    Aug 15, 2008
  4. Peter
    Replies:
    1
    Views:
    346
    Peter
    Jul 2, 2009
  5. Nathan Sokalski

    Controls inside EditTemplate cause editing to end

    Nathan Sokalski, Sep 7, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    117
    Nathan Sokalski
    Sep 7, 2005
Loading...

Share This Page