J
J055
Hi
I'm trying to get an instance of UserLists to persist after it's been used
by the GridView. I understand from the documentation that The
OnObjectCreated event allows access to the instance. I have a TotalUsers
property which is initiated when the GetUsers method is called, however it
is empty after the OnObjectCreated event runs. What am I doing wrong? Is
there a way to get the Row count from the GetUsers method (It is a
DataTable)? I don't want to call the GetUsers method twice.
Thanks for your help.
Andrew
protected void Page_Load(object sender, EventArgs e)
{
ObjectDataSource1.TypeName = "Business.UserLists";
ObjectDataSource1.SelectMethod = "GetUsers";
}
protected void ObjectDataSource_Created(object sender,
ObjectDataSourceEventArgs e)
{
UserLists users = (UserLists)e.ObjectInstance;
Response.Write(users.TotalUsers.ToString());
}
I'm trying to get an instance of UserLists to persist after it's been used
by the GridView. I understand from the documentation that The
OnObjectCreated event allows access to the instance. I have a TotalUsers
property which is initiated when the GetUsers method is called, however it
is empty after the OnObjectCreated event runs. What am I doing wrong? Is
there a way to get the Row count from the GetUsers method (It is a
DataTable)? I don't want to call the GetUsers method twice.
Thanks for your help.
Andrew
protected void Page_Load(object sender, EventArgs e)
{
ObjectDataSource1.TypeName = "Business.UserLists";
ObjectDataSource1.SelectMethod = "GetUsers";
}
protected void ObjectDataSource_Created(object sender,
ObjectDataSourceEventArgs e)
{
UserLists users = (UserLists)e.ObjectInstance;
Response.Write(users.TotalUsers.ToString());
}