Monday 5 November 2007

Databinding in Page_Load VS LINQ Data Source Selecting Event

While it is nice to have all your databinding code in Page_Load (e.g. in a LoadData() method), it is preferable to use the DataSource Selecting Event. e.g.

   1:  linqDSProducts_Selecting(object sender, LinqDataSourceSelectEventArgs e)

This is because you retain full support for Data source pagination and sorting - which equals less code (declarative or programmatic). For more details on using the Selecting event with LINQ datasources, see

1 comment:

andrew said...