Bound data to datalist if tabpanel is selected

Last post 10-05-2007 4:59 AM by Jonathan Shen – MSFT. 1 replies.

Sort Posts:

  • Bound data to datalist if tabpanel is selected

    09-29-2007, 10:11 PM
    • Member
      292 point Member
    • s2002
    • Member since 10-04-2005, 4:42 PM
    • Posts 232

    I have Put tab container with 2 Tab Panel on webpage. In each TabPanel there is A datalist
    which retrieves data from MSSQL DB. What I want to know is when the Data bound events for these 2 datalists occurs.
    Do the datalists retrieve data at the same time or only the datalist which it's Tab Panel is active will fetch data.

    What I want to do is: DataList data bound Process only occurs if it's owned tab is selected.
    I don't want both datalists loaded at page load event.
    What sould I do?

  • Re: Bound data to datalist if tabpanel is selected

    10-05-2007, 4:59 AM
    Answer

    Hi S2002,

    s2002:
    What I want to know is when the Data bound events for these 2 datalists occurs.
    Do the datalists retrieve data at the same time or only the datalist which it's Tab Panel is active will fetch data.

    Yes, they will be all binded before PreRender.Download "Data Binding Events for Data-Bound Controls"(document), please click here.  For more about the life cycle, please visit here.  

    s2002:
    What I want to do is: DataList data bound Process only occurs if it's owned tab is selected.
    I don't want both datalists loaded at page load event.
    What sould I do?
     

    Yes , you can first get the ActiveTabIndex then bind DataSource to the DataList which is located inside the Tab according to the ActiveTabIndex. It is recommended to do this on Page_Load event.

    I hope this help.

    Best regards,

    Jonathan

     

     

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)