K
Ken Varn
I am just starting the process of creating ASP.NET server controls. I have
created controls for .NET applications, but have just started with ASP.NET.
I am a little confused about some areas that I am hoping someone can help
clear up.
1. What is the difference between initializing a control in the
constructor, vs the OnInit(), vs the CreateChildControls() methods?
2. The control that I created contains an Items collection attribute that I
implemented. I am using the base WebControl class for my control and
constructed it using the DIV type. I noticed that the Items attribute was
rendered to the web page as a Items="(Collection)" attribute. Why and how
does the base class know to add this to the attribute of the <DIV> tag?
What is the significance of setting this attribute since the state of the
data is not preserved?
3. I implemented the data postback interface and registered it using
RegisterRequiresPostback(). When using the debugger, I notice that the
LoadPostData method is called prior to calling the OnInit() method. Why is
this? I would expect the OnInit() method be called first?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------
created controls for .NET applications, but have just started with ASP.NET.
I am a little confused about some areas that I am hoping someone can help
clear up.
1. What is the difference between initializing a control in the
constructor, vs the OnInit(), vs the CreateChildControls() methods?
2. The control that I created contains an Items collection attribute that I
implemented. I am using the base WebControl class for my control and
constructed it using the DIV type. I noticed that the Items attribute was
rendered to the web page as a Items="(Collection)" attribute. Why and how
does the base class know to add this to the attribute of the <DIV> tag?
What is the significance of setting this attribute since the state of the
data is not preserved?
3. I implemented the data postback interface and registered it using
RegisterRequiresPostback(). When using the debugger, I notice that the
LoadPostData method is called prior to calling the OnInit() method. Why is
this? I would expect the OnInit() method be called first?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------