Last post Apr 26, 2011 05:30 AM by shtrudel
Apr 25, 2011 11:05 AM|shtrudel|LINK
If DataSource Is Nothing And DataSourceID = String.Empty Then Throw New HttpException("No data source selected") End If
What is the best practice for the above ?
Apr 25, 2011 07:14 PM|jkirkerx|LINK
I belive the datasource is part of the object.
So if it's a gridview, and the name of the object is Gridview, then it would be Gridview.Datasource
In vb it's
If Gridview.Datasource is Nothing Then
If Girdview.Datasource = string.empty Then
Apr 26, 2011 05:30 AM|shtrudel|LINK
How and where is the best place to check that data source has been assigned to a custom control?
Okay then, I placed the following in my control init routine and handled the event in the hosting page and it seems that it works fine.
Try If DataSource Is Nothing And DataSourceID = String.Empty Then Throw New ArgumentException("No data source defined") End If Catch ex As Exception RaiseEvent dataError() End TryThank you all for trying to help