ASP.NET 2.0: Specifying an instance of an object for an ObjectDataSource
Posted
by Austin Salonen
on Stack Overflow
See other posts from Stack Overflow
or by Austin Salonen
Published on 2008-12-29T18:06:35Z
Indexed on
2010/05/20
14:40 UTC
Read the original article
Hit count: 509
I'm using an ObjectDataSource to bind data to a GridView; it works fine except that it always creates a new object to use as a data source. I can do all the setup just fine but I cannot use an instance of an existing object to specify as the "data source" for it. Is it possible to do this? If so, how?
If it's not possible, why?
EDIT: Here's the gist of what's going on (object types changed): On the first page you are editting the attributes for a dog. One of the attributes is "has puppies" and if it's true, the next page you specify the names of those puppies. What's happening in my case is that those puppies are not getting linked to the original dog but to a "new" dog. (The implication that my problem is a "female dog" was coincidental. ;-) )
© Stack Overflow or respective owner