custom control?

  • Thread starter Thread starter ll
  • Start date Start date
L

ll

I try to write a custom controls contain two dropdownbox..
I have two questions here, please advice.
1. Using ¡°Programmatic Composites¡±, the CreateChildControl method is called very early in the control¡¯s lifetime. Where is the place to initialize the value for the dropdownbox( for example, the selected index). I tried to put into the Page_Load() of the ASPX page, but Page_Load is fired after CreateChildControls?
2. Using ¡°Render¡± way, I can see the event sequence is like this: ASPX Page_Load(initialize the value¡­) ¨C Control¡¯s ¡°Render¡±, but how to retrieve the dropdownbox¡¯s value?

Thanks.
 
Usually, you can put it in the OnInit() method. (If you are using VS.NET,
the default OnInit() is collapsed in the designer block, you have to find
it. )

Jianjun


ll said:
I try to write a custom controls contain two dropdownbox..
I have two questions here, please advice.
1. Using ¡°Programmatic Composites¡±, the CreateChildControl method is
called very early in the control¡¯s lifetime. Where is the place to
initialize the value for the dropdownbox( for example, the selected index).
I tried to put into the Page_Load() of the ASPX page, but Page_Load is fired
after CreateChildControls?
2. Using ¡°Render¡± way, I can see the event sequence is like this: ASPX
Page_Load(initialize the value¡­) ¨C Control¡¯s ¡°Render¡±, but how to
retrieve the dropdownbox¡¯s value?
 
Back
Top