Hi,
While dealing with
Dynamic TextBox Controls
in ASP.NET you have to consider few things.
First
, In which event you are creating the control and second are you
adding
them in Control Hierarchy or not.
If you check the ASP.NET Page Lifecycle, Before
Page_Load
, there are few methods
PreInit(),
Init(),
LoadViewStateData()
and
LoadPostBackData()
. Most of the developer create dynamic Controls in
Page_Load()
or In some event like Button Click. But those control will never get the data from
LoadViewState()
or
LoadPostBackData()
as control are been created after
Init()
they are not part of the control hiearchy. ASP.NET Loads Postback and View State data based on the control hierarchy tree which are created in
init()
events.
So, you have to make sure you are creating the control in proper place. I hope this will helps you to know the internals and you can dig dive!
This article while help you to deep inside of ASP.NET Text box, which I refered many times :)
ViewState and Postback[
^]
Cheers!!