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. 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. Brian
    Replies:
    1
    Views:
    2,768
    Brian
    Dec 22, 2003
  2. Etienne Tremblay

    DataList editing

    Etienne Tremblay, Mar 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    401
    Simon Gorski
    Mar 3, 2004
  3. Nevyn Twyll
    Replies:
    8
    Views:
    1,889
  4. Replies:
    0
    Views:
    596
  5. oldyork90
    Replies:
    1
    Views:
    163
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page