D
dave.dolan
I have an objectdatasource pointing to a special custom built proxy that hits
an xml webservice to return a collection of my business objects, and I'm
binding them to a grid view. I noticed that it takes a lot longer than it
would if I just do the query with the proxy and print the values of the same
number of objects. I thought at first I was seeing the result of reflection
and deserialization, but I put a breakpoint on my read method and it turns
out that the objectdatasource is requesting my data, which hits the web
service, TWICE per page load. I'm not calling databind directly on the
gridview or objectdatasource ever, but the object data source is using some
databound controls as a source for some of it's parameters.
Could the source of this problem be that I'm re-binding data to the other
controls serving as a parameter to the object datasource and it's checking
again, on something like Page_Unload or other to verify that it's contents
are correct? Is there any way I can turn that off?
It's like this, in more detail:
The ObjectDataSource calls a static method of a proxy class that wraps a
call to the webservice. (Not generated by WSDL.EXE, but it works the same
way -- The data comes back just fine, and only once when I run it without the
object data source, specifying the parameters to the static method by hand of
course) The object datasource has four parameters, a search method
(dropdown), the search text (textbox), a search logical operation
(dropdown), and an operand for the logical operation (textbox) The logical
operations differ for search methods on text fields than those of numeric
fields, so I rebind them whenever the search method changes.
Does rebinding a control that serves as a parameter like that cause another
query to the ODS? or is something else going on that I may be doing wrong?
Surely it's not meant to hit the data source twice for each load...
an xml webservice to return a collection of my business objects, and I'm
binding them to a grid view. I noticed that it takes a lot longer than it
would if I just do the query with the proxy and print the values of the same
number of objects. I thought at first I was seeing the result of reflection
and deserialization, but I put a breakpoint on my read method and it turns
out that the objectdatasource is requesting my data, which hits the web
service, TWICE per page load. I'm not calling databind directly on the
gridview or objectdatasource ever, but the object data source is using some
databound controls as a source for some of it's parameters.
Could the source of this problem be that I'm re-binding data to the other
controls serving as a parameter to the object datasource and it's checking
again, on something like Page_Unload or other to verify that it's contents
are correct? Is there any way I can turn that off?
It's like this, in more detail:
The ObjectDataSource calls a static method of a proxy class that wraps a
call to the webservice. (Not generated by WSDL.EXE, but it works the same
way -- The data comes back just fine, and only once when I run it without the
object data source, specifying the parameters to the static method by hand of
course) The object datasource has four parameters, a search method
(dropdown), the search text (textbox), a search logical operation
(dropdown), and an operand for the logical operation (textbox) The logical
operations differ for search methods on text fields than those of numeric
fields, so I rebind them whenever the search method changes.
Does rebinding a control that serves as a parameter like that cause another
query to the ODS? or is something else going on that I may be doing wrong?
Surely it's not meant to hit the data source twice for each load...