SQLDataSource binding timing

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?
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top