where in page life cycle should databound control populate its data?

T

TS

i'm curious as to which events should a drop down list's values be loaded
and when the correct value should be set selected.

And what is the logic behind this timing?

thanks!!!
 
T

TS

also is there any concerns with AJAX?

someone at work said he had to move the code that was binding a drop down
list from OnLoad to onPreRender because of an issue with Ajax
 
S

Steven Cheng[MSFT]

Hi TS,

AS for databinding and data population for a control, I think it can be
performed at any events before the page render its content. Therefore, all
the following page events during the server-side processing is ok:

Init, Load, PreRender

Actually, from MSDN document, you can get "PreRender" is the last event you
can make changes(which will be persisted into viewstate). Also,
databinding is not necessarily be performed on every request, only when
data changed will you need to perform databinding(or at the first request)
since most databound control store bound data into viewstate(for populating
control collection in sequential requests).

For AJAX, normally, it just do the postback in background thread through
xmlhttp, therefore, I think the basic logic mentioned above is also
suitable. For particular problem or issue, it will depend on how that
problem will affect the page processing or control lifecycle.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.





--------------------
 
T

TS

thanks steven

Steven Cheng said:
Hi TS,

AS for databinding and data population for a control, I think it can be
performed at any events before the page render its content. Therefore, all
the following page events during the server-side processing is ok:

Init, Load, PreRender

Actually, from MSDN document, you can get "PreRender" is the last event
you
can make changes(which will be persisted into viewstate). Also,
databinding is not necessarily be performed on every request, only when
data changed will you need to perform databinding(or at the first request)
since most databound control store bound data into viewstate(for
populating
control collection in sequential requests).

For AJAX, normally, it just do the postback in background thread through
xmlhttp, therefore, I think the basic logic mentioned above is also
suitable. For particular problem or issue, it will depend on how that
problem will affect the page processing or control lifecycle.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no
rights.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top