First you need to write code for the ObjectCreating event of the ODS, like this:
Code:
Protected Sub ObjectDataSource1_ObjectCreating(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.ObjectDataSourceEventArgs) _
Handles ObjectDataSource1.ObjectCreating
Dim myInstance As New MyClass()
myInstance.myProp = "Whatever value you need here"
e.ObjectInstance = myInstance
End Sub
That way, an instance of your business object is created when the ODS is about to call your method.
Next, within your method, you should be able to retrieve the myProp property (using m_myprop or myProp) and get at the value you set in the ObjectCreating event in the page.
Hope this helps,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
Beginning ASP.NET 3.5 : in C# and VB,
ASP.NET 2.0 Instant Results and
Dreamweaver MX 2004
Want to be my colleague? Then check out this post.