SQLDataSource binding timing

  • Thread starter Thread starter Mark B
  • Start date Start date
M

Mark B

I am using SQLDataSource to populate a Dropdownlist box. But while debugging
the Dropdownlist item count is always 0. I have also checked in the
Prerender event and the Dropdownlist item count is still 0 but when the page
is loaded the items are bound and populated. When are the items exactly
bound to the dropdown?
 
Controls with declarative databinding get bound in their PreRender event. If
you want to catch the moment right after databinding, use the DataBound
event and than you don't need to care about when exactly it happens.


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Mark B said:
I am using SQLDataSource to populate a Dropdownlist box. But while
debugging
the Dropdownlist item count is always 0. I have also checked in the
Prerender event and the Dropdownlist item count is still 0 but when the
page
is loaded the items are bound and populated. When are the items exactly
bound to the dropdown?


__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4074 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4074 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
Back
Top