I'm starting to think all these 'no code' data controls are more obfuscation and BS than they're worth.
Here is a page that talks about some issues that might cause multiple Selects it turned out to be just that, we're hiding/showing columns in the Grid View.
Data Bound event, and if we don't do that, it's doesn't fire twice.
page=ASPFaq Events Double Fire I had the same problem - the problem was that I was hiding/showing a column after, or during, databinding.
Moving the hide/show code before the databinding stopped the binding from happening twice, which I suspect is the same effect as moving it to the Page_Load.
Can someone explain exactly how/when an Object Data Source fires? NET page, with a Grid View, which is referencing an ODS.
I put a breakpoint in the method the ODS is using, and noticed it was firing twice.
I looked into the code and the answer seemed obvious at first.
I had where Method A and Method B were both eventually calling gv. This made sense because I assume that each call to Grid View.
In my case the databind was happening in response to a dropdown listbox change - doing the column add/remove before the With our scenario it also turned out that we had some columns specified in the markup, and the ods would get hold of those and bind the first time, and then we were injecting columns dynamically with ITemplate classes and that was triggering a rebind. Multiple calls to a gridview's databind method can occur implicitly if you're changing the visibility, i.e., showing and/or hiding, the columns of a gridview tied to an object data source.
I'll check out your link, but which method did you use to solve the situation?
"when comment out the call to Method A, it still fires twice". Probably you have Auto Event Wireup="true" and also registering event in code