Can someone explain how / when the ObjectDataSource is launched? I have an ASP.NET page with a GridView that links to ODS. I set a breakpoint in the method used by ODS and noticed that he shot twice.
I looked at the code, and at first it seemed obvious. I had
Page_Load()
{
if(!Page.IsPostBack)
{
MethodA();
MethodB();
}
}
where MethodA and MethodB both called gv.DataBind (). This made sense, since I assume that every call to GridView.DataBind () will result in an ODS request for the data and therefore trigger a data access method.
The strange thing is that when commenting on a MethodA method call, it still fires twice. Checking the call stack shows that the method starts first as a result of MethodB, and then again without a path, except for [External Code]. This covert load does not occur when I allow MethodA and MethodB to execute.
Any idea what is going on here? Any idea, what other code could I have that is requesting ODS data? I'm starting to think that all of these "codeless" data controls are more obfuscated and BS than they are worth it.
source
share