custom control?

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.
 
J

Jj

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top