When/Why to use Page.Bind

  • Thread starter Thread starter Anand Sagar
  • Start date Start date
A

Anand Sagar

The DataBind I understand is useful for binding data from datasources to
WebControls like dropdownlist, datagrid etc. usually during the Page_Load or
Page_Init

In what cases will anyone use a Page.DataBind ?

Thanks,
Anand Sagar
 
I see it as as a convenience when I don't want to issue a control.databind for each of my controls. I assign all the datasources then call Page.DataBind which binds everything in one command. I'd be careful with this command though, if you have controls which are already bound, this will rebind them, which can slow down your page unnecessarily.
 
Back
Top