Timmy, I am very well aware of whatever you have said & thanks for the
same. Actually my primary intention of posting that question was to get
my confusions clarified on the difference between the firing of the
Page_Load sub & the DataGrid's OnItemCreated event.
Consider the following code snippet:
<script runat="server">
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
'connecting to a database table, retrieving
'records & display them in the DataGrid
DataGrid1.DataBind()
End Sub
Sub CreateItem(ByVal obj As Object, ByVal ea As
DataGridItemEventArgs)
Dim intIndex As Integer = ea.Item.ItemIndex
'some code here
DataGrid1.DataBind()
End Sub
</script>
<form runat="server">
<asp

ataGrid ID="DataGrid1" OnItemCreated="CreateItem"
AutoGenerateColumns="false" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="Name">
<ItemTemplate>
<asp:Label ID="lblName" runat="server"><%# Container.DataItem("Name")
%></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="Adr" HeaderText="Address"/>
<asp:BoundColumn DataField="City" HeaderText="City"/>
<asp:BoundColumn DataField="State" HeaderText="State"/>
<asp:BoundColumn DataField="Ctry" HeaderText="Country"/>
<asp:EditCommandColumn HeaderText="CHANGE" EditText="EDIT"
UpdateText="CHANGE" CancelText="CANCEL" runat="server"/>
</Columns>
</asp

ataGrid>
</form>
When the user comes to this page for the first time, "Page_Load" will
execute first after which the "OnItemCreated" event will be fired. Next
the user clicks the "EDIT" link. If I am not mistaken, this means that
ASP.NET will have to create this page again right from the scratch when
the "EDIT" link is clicked (please do correct me if I am wrong). Under
such circumstances, will "Page_Load" execute before the "OnItemCreated"
event fires or will the "OnItemCreated" event fire before "Page_Load"
executes?
Thanks,
Arpan