on the msdn we have this http://msdn.microsoft.com/en-us/library/ms972976.aspx. Generally the life of a web site looks like this: Initialization->LoadViewState->LoadPostBackData->Load->RaisePostBackEvent->SaveViewState->Render
I have a placeholder on my aspx side it looks like this:
<asp:PlaceHolder ID="ph1" runat="server">
<asp:Button OnClick="ClickMe" ID="Button1" runat="server" Text="Button" />
</asp:PlaceHolder>
I'm creating two textboxes on the Page Load event the code looks like this:
for (int i = 0; i <2; i++)
{
TextBox tb = new TextBox();
tb.ID = "tb" + i.ToString();
tb.Text = "my test string";
ph1.Controls.Add(tb);
}
And the click button event looks like this:
protected void ClickMe(object sender, EventArgs e)
{
var mycontrols = ph1.Controls;
}
When I put sommething in to those textboxes and click the button the page is postedback but my textboxes hold the inputed values despite the fact that I'm changing their text property on the page Load event. Those controls are created dynamically on the Load event which is fired after the LoadViewState and LoadPostBackData so how does it work?? When do controls receive their postdata??