The DataSource controls provide the necessary logic to bind your controls on
each page load. If you want more control, wire up the Selecting event. This
event allows you to specify whether you want the DataSource control to bind
data or not on that particular page load. Here's an example:
Sub AccessDataSource1_Selecting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceSelectingEv entArgs)
If DateTime.Now.DayOfWeek = DayOfWeek.Monday Then
e.Cancel = True
End If
End Sub
In this example, the AccessDataSource control named AccessDataSource1 will
only bind the data if it's Tuesday-Sunday.
Happy coding,
Johann MacDonagh
"Davids" <db****@simnet.is> wrote in message
news:co**********@news.simnet.is...
I have an AccessDataSource control and a DataList control and databinding
to display the database results. Although there is no Page.DataBind() in my
codebehind code it obviously is there somewhere, do the controls do it or
is it by default done in the page building sequence?
How can I control my self if that particular control is to be databound or
not?