[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

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

TS

11/16/2007 9:43:00 PM

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!!!


17 Answers

TS

11/16/2007 10:17:00 PM

0

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

"TS" <manofsteele1@nospam.nospam> wrote in message
news:OzdYxmJKIHA.5860@TK2MSFTNGP04.phx.gbl...
> 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!!!
>


stcheng

11/19/2007 3:13:00 AM

0

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....
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/de....

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


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





--------------------
>Subject: Re: where in page life cycle should databound control populate
its data?
>Date: Fri, 16 Nov 2007 16:16:56 -0600

>
>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
>
>"TS" <manofsteele1@nospam.nospam> wrote in message
>news:OzdYxmJKIHA.5860@TK2MSFTNGP04.phx.gbl...
>> 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!!!
>>
>
>
>

TS

11/19/2007 1:14:00 PM

0

thanks steven

"Steven Cheng[MSFT]" <stcheng@online.microsoft.com> wrote in message
news:bcqyOpmKIHA.4200@TK2MSFTNGHUB02.phx.gbl...
> 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....
> 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/de....
>
> ==================================================
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>
>
>
> --------------------
>>Subject: Re: where in page life cycle should databound control populate
> its data?
>>Date: Fri, 16 Nov 2007 16:16:56 -0600
>
>>
>>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
>>
>>"TS" <manofsteele1@nospam.nospam> wrote in message
>>news:OzdYxmJKIHA.5860@TK2MSFTNGP04.phx.gbl...
>>> 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!!!
>>>
>>
>>
>>
>


Oy rool out a carbon tax

12/16/2010 11:00:00 PM

0

jg wrote:
> ralph wrote:
>> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <seon@iinet.net.au> wrote:
>>
>>> Now they have something else to attack Labor with. But little do they
>>> know the more they use this the more they look like arseholes.
>>>
>>
>> Instead of understanding why this tragedy happened and how future
>> repeats might be avoided, you choose to post outrageous suggestions
>> that some people are "glad" that 28 people died needlessly?
>>
>> F*cking disgraceful.
>
>
> Both sides have been using it as a football, partly why they are
> haemorrhageing votes.

I haven't heard the Libs making any comment on the situation... not a peep.

> I wonder if the boat people blame anyone here, or if those waiting
> patiently in camps overseas do.
>
>


--
Labor-Green open borders plan in action...

Number of illegal aliens in detention (nearest hundred):

Jan 2005 __________ 1000
Jul 2005 ________ 800
Jan 2006 _________ 900
Jul 2006 ______ 600
Jan 2007 _____ 500
Jul 2007 ____ 400
Jan 2008 ____ 400
Jul 2008 ___ 300
Jan 2009 ___ 300 -> Rudd stops TPVs
Jul 2009 __________ 1000
Jan 2010 _________________ 1700
Jul 2010 ______________________________ 2000

Boat watch alert: 4 boats arrive in last 2 days - 7/11/2010
- more than 6000 people arrive in 2010 and 121 boats
- 35 boats arrive since the 21/8/2010 election - more than 1700 people
- 100 illegals in 3 boats over 2 days transferred to Christmas Is. -
29/11/2010

** - more than 27 innocent people die as a direct result of Rudd/Gillard
open borders policy - 15/12/2010 **

jg

12/16/2010 11:33:00 PM

0

Oy rool out a carbon tax wrote:
> jg wrote:
>> ralph wrote:
>>> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <seon@iinet.net.au> wrote:
>>>
>>>> Now they have something else to attack Labor with. But little do they
>>>> know the more they use this the more they look like arseholes.
>>>>
>>> Instead of understanding why this tragedy happened and how future
>>> repeats might be avoided, you choose to post outrageous suggestions
>>> that some people are "glad" that 28 people died needlessly?
>>>
>>> F*cking disgraceful.
>>
>> Both sides have been using it as a football, partly why they are
>> haemorrhageing votes.
>
> I haven't heard the Libs making any comment on the situation... not a peep.
>

Not this time, yet. The issue of boat people has been political game
since we went to war in Iraq and Afghanistan. Before that it was the odd
Indonesian, but you can't raise as much hate around them. Before that it
was Vietnamese boats, but the liblabs were a bit more civilised then.


AStext

12/16/2010 11:59:00 PM

0

On Dec 16, 10:00 pm, ralph <rstead...@geocities.com> wrote:
> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <s...@iinet.net.au> wrote:
> >Now they have something else to attack Labor with. But little do they know
> >the more they use this the more they look like arseholes.
>
> Instead of understanding why this tragedy happened and how future
> repeats might be avoided, you choose to post outrageous suggestions
> that some people are "glad" that 28 people died needlessly?
>
> F*cking disgraceful.

That's a moral relativist for you, always avoiding the issue.

Oy rool out a carbon tax

12/17/2010 3:08:00 AM

0

jg wrote:
> Oy rool out a carbon tax wrote:
>> jg wrote:
>>> ralph wrote:
>>>> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <seon@iinet.net.au> wrote:
>>>>
>>>>> Now they have something else to attack Labor with. But little do they
>>>>> know the more they use this the more they look like arseholes.
>>>>>
>>>> Instead of understanding why this tragedy happened and how future
>>>> repeats might be avoided, you choose to post outrageous suggestions
>>>> that some people are "glad" that 28 people died needlessly?
>>>>
>>>> F*cking disgraceful.
>>>
>>> Both sides have been using it as a football, partly why they are
>>> haemorrhageing votes.
>>
>> I haven't heard the Libs making any comment on the situation... not a
>> peep.
>>
>
> Not this time, yet. The issue of boat people has been political game
> since we went to war in Iraq and Afghanistan. Before that it was the odd
> Indonesian, but you can't raise as much hate around them. Before that it
> was Vietnamese boats, but the liblabs were a bit more civilised then.
>

I think the Libs are wisely keeping their noses out of it. They will let
the facts speak for themselves. Also wise is their rejection of
Gillard's invitation to join her "let's all share the blame" committee.
She knows the coalition's proposed solution - reintroduce the Pacific
Solution. Libs are wise to simply maintain this position.

--
Labor-Green open borders plan in action...

Number of illegal aliens in detention (nearest hundred):

Jan 2005 __________ 1000
Jul 2005 ________ 800
Jan 2006 _________ 900
Jul 2006 ______ 600
Jan 2007 _____ 500
Jul 2007 ____ 400
Jan 2008 ____ 400
Jul 2008 ___ 300
Jan 2009 ___ 300 -> Rudd stops TPVs
Jul 2009 __________ 1000
Jan 2010 _________________ 1700
Jul 2010 ______________________________ 2000

Boat watch alert: 4 boats arrive in last 2 days - 7/11/2010
- more than 6000 people arrive in 2010 and 121 boats
- 35 boats arrive since the 21/8/2010 election - more than 1700 people
- 100 illegals in 3 boats over 2 days transferred to Christmas Is. -
29/11/2010

** - more than 27 innocent people die as a direct result of Rudd/Gillard
open borders policy - 15/12/2010 **

i|||| | | || ||| || |||| 2.0

12/17/2010 3:16:00 AM

0


"jg" <jg@nospam.com> wrote in message
news:NgxOo.5302$gM3.1334@viwinnwfe01.internal.bigpond.com...
> Oy rool out a carbon tax wrote:
>> jg wrote:
>>> ralph wrote:
>>>> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <seon@iinet.net.au> wrote:
>>>>
>>>>> Now they have something else to attack Labor with. But little do they
>>>>> know the more they use this the more they look like arseholes.
>>>>>
>>>> Instead of understanding why this tragedy happened and how future
>>>> repeats might be avoided, you choose to post outrageous suggestions
>>>> that some people are "glad" that 28 people died needlessly?
>>>>
>>>> F*cking disgraceful.
>>>
>>> Both sides have been using it as a football, partly why they are
>>> haemorrhageing votes.
>>
>> I haven't heard the Libs making any comment on the situation... not a peep.
>>
>
> Not this time, yet. The issue of boat people has been political game since we went to
> war in Iraq and Afghanistan. Before that it was the odd Indonesian, but you can't raise
> as much hate around them. Before that it was Vietnamese boats, but the liblabs were a
> bit more civilised then.

I expect the proto-Aboriginals wondered when all these furiner Aboriginals would stop
coming, and they wondered when all these neuvo-Aboriginals would stop coming, and now....

What does multiculturalism say about integrating a Xenophobic culture?
Does Ethnicity mean your parents and their parents and their parents were Xenophobic?



jg

12/17/2010 3:42:00 AM

0

i|||| | | || ||| || |||| 2.0 wrote:
> "jg" <jg@nospam.com> wrote in message
> news:NgxOo.5302$gM3.1334@viwinnwfe01.internal.bigpond.com...
>> Oy rool out a carbon tax wrote:
>>> jg wrote:
>>>> ralph wrote:
>>>>> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <seon@iinet.net.au> wrote:
>>>>>
>>>>>> Now they have something else to attack Labor with. But little do they
>>>>>> know the more they use this the more they look like arseholes.
>>>>>>
>>>>> Instead of understanding why this tragedy happened and how future
>>>>> repeats might be avoided, you choose to post outrageous suggestions
>>>>> that some people are "glad" that 28 people died needlessly?
>>>>>
>>>>> F*cking disgraceful.
>>>> Both sides have been using it as a football, partly why they are
>>>> haemorrhageing votes.
>>> I haven't heard the Libs making any comment on the situation... not a peep.
>>>
>> Not this time, yet. The issue of boat people has been political game since we went to
>> war in Iraq and Afghanistan. Before that it was the odd Indonesian, but you can't raise
>> as much hate around them. Before that it was Vietnamese boats, but the liblabs were a
>> bit more civilised then.
>
> I expect the proto-Aboriginals wondered when all these furiner Aboriginals would stop
> coming, and they wondered when all these neuvo-Aboriginals would stop coming, and now....
>
> What does multiculturalism say about integrating a Xenophobic culture?
> Does Ethnicity mean your parents and their parents and their parents were Xenophobic?
>
>
>
If you are asking me I don't know. Nor do I know if multiculturalism was
behind the joint liblab abandonment of the white Australia policy.

I believe I'm not the only one who didn't mind furiners until about 1970
when we had enough people, thanks, but was always concerned that what
could happen to involve us with arabs... has.


jg

12/17/2010 3:51:00 AM

0

Oy rool out a carbon tax wrote:
> jg wrote:
>> Oy rool out a carbon tax wrote:
>>> jg wrote:
>>>> ralph wrote:
>>>>> On Thu, 16 Dec 2010 16:25:16 +1100, "Seon" <seon@iinet.net.au> wrote:
>>>>>
>>>>>> Now they have something else to attack Labor with. But little do they
>>>>>> know the more they use this the more they look like arseholes.
>>>>>>
>>>>> Instead of understanding why this tragedy happened and how future
>>>>> repeats might be avoided, you choose to post outrageous suggestions
>>>>> that some people are "glad" that 28 people died needlessly?
>>>>>
>>>>> F*cking disgraceful.
>>>> Both sides have been using it as a football, partly why they are
>>>> haemorrhageing votes.
>>> I haven't heard the Libs making any comment on the situation... not a
>>> peep.
>>>
>> Not this time, yet. The issue of boat people has been political game
>> since we went to war in Iraq and Afghanistan. Before that it was the odd
>> Indonesian, but you can't raise as much hate around them. Before that it
>> was Vietnamese boats, but the liblabs were a bit more civilised then.
>>
>
> I think the Libs are wisely keeping their noses out of it. They will let
> the facts speak for themselves. Also wise is their rejection of
> Gillard's invitation to join her "let's all share the blame" committee.
> She knows the coalition's proposed solution - reintroduce the Pacific
> Solution. Libs are wise to simply maintain this position.
>

Yes that's smart, and since the libs don't have much of an answer
either, the committee is obviously a face saving exercise.

But no one seems to notice that mussies are flying in by the truckload
invited as immigrants, while we bicker about a handful with perhaps a
better reason to want to escape. Our dislike of all of them is borne by
first asylum seekers and then transfered to whichever political party we
don't like. It's weird and the liblabs fuel it.