Best practice for editing a Datalist

Discussion in 'ASP .Net' started by Ryu, Sep 3, 2004.

  1. Ryu

    Ryu Guest

    Hi

    I have method that binds data to the DataList.

    void BindControls()
    {
    //Code Here
    DataList.DataBind();
    }

    And I have a ItemBound event that will fire after DataBind() is called.
    Right now I would like to edit the selected index in the DataList (dl).

    private void d_EditCommand(object source, DataListCommandEventArgs e)
    {
    BindControls();
    }
    As you can see, I have to call BindControls() again which will have to make
    calls to the database again. I don't think this method is very effiicient.
    Is there any workaround to fire the ItemBound event without going through
    the BindControls()?



    Thanks
     
    Ryu, Sep 3, 2004
    #1
    1. Advertisements

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 Rossney
    Replies:
    0
    Views:
    659
    Robert Rossney
    Feb 7, 2006
  2. Brian
    Replies:
    1
    Views:
    2,917
    Brian
    Dec 22, 2003
  3. Etienne Tremblay

    DataList editing

    Etienne Tremblay, Mar 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    464
    Simon Gorski
    Mar 3, 2004
  4. Nevyn Twyll
    Replies:
    8
    Views:
    2,324
  5. Replies:
    3
    Views:
    2,173
  6. HP
    Replies:
    0
    Views:
    526
  7. Replies:
    0
    Views:
    827
  8. oldyork90
    Replies:
    1
    Views:
    311
    Jeremy J Starcher
    Sep 10, 2008
Loading...