Sometimes when using ObjectDataSource you need to have access to the object that ObjectDataSource is using. Maybe you have a custom constructor you need to call, maybe you need to hook up an event handler, etc.
Once again, ASP.Net 2.0 comes through.
protected void ObjectDataSource1_ObjectCreated(object sender, ObjectDataSourceEventArgs e)
{
BLL bll = (BLL)e.ObjectInstance;
bll.haveToSetThis = "not really";
}
You should also look at ObjectCreating event since can be used to actually create the instance of the object.
No comments:
Post a Comment