views:

973

answers:

1

Hello,


Q1

A) On a postback, when in the page’s life cycle are GridView’s rows populated with all the values it had before user issued a postback? Thus at what point does GridView already have all the values it displayed on user’s page?

I’m assuming this happens the same time it happens with other controls, which is during Load ViewState Data stage?!


B) Text user entered into TextBox control is made available after Load Postback Data stage. Shouldn’t changes user made to GridView’s fields also be available after Load Postback Data stage?


Q2 - Are there any differences between the way SelectedIndexChanged event is handled when DropDownList is defined inside GridView’s template and when DropDownlist is defined outside GridView? Meaning, is in both cases the event fired at the same point in Page’s life cycle?


thanx

+3  A: 

See Control Execution Lifecycle in msdn to clear any confussion around the control lifecycle.

A) that's right, during load view state.

B) Yes, they should be available, which means they are available on page load.

Q2 in the same point in the page's life cycle: yes, during Send postback change notifications. Warning: the following conditions could affect it:

  • Turning on auto postback. I think in this case the event is raised during: "Handle postback events"
  • Changing it in place, will probably affect when it occurs in relation to other events during during the stage.
eglasius
thanx for helping and sorry for not replying sooner
SourceC