accessing child controls

V

vespaboy

i have a calendar control and i have added a dropdownlist control to
each day using the OnDayRender method:

Dim ddl As DropDownList = New DropDownList
ddl.AutoPostBack = True
....
....
e.Cell.Controls.Add(ddl)

However the autopostback event is not firing, indeed no autopostback
code is added to the rendered <select>.

Can anyone advise how to make autopostback work and to access the
values of each select in the postback.

Thanks in advance

Dan
 
G

Guest

i have a calendar control and i have added a dropdownlist control to
each day using the OnDayRender method:

Dim ddl As DropDownList = New DropDownList
ddl.AutoPostBack = True
...
...
e.Cell.Controls.Add(ddl)

However the autopostback event is not firing, indeed no autopostback
code is added to the rendered <select>.

Can anyone advise how to make autopostback work and to access the
values of each select in the postback.

Thanks in advance

Dan

Auto post back on what event?

ddl.{event_here} += New EventHandler({your_sub_here})
 
V

vespaboy

Auto post back on what event?

ddl.{event_here} += New EventHandler({your_sub_here})

auto postback on selectedindexchanged. i've tried:

AddHandler ddl.SelectedIndexChanged, AddressOf
ddl_SelectedIndexChanged

but still nothing
 
G

Guest

auto postback on selectedindexchanged. i've tried:

AddHandler ddl.SelectedIndexChanged, AddressOf
ddl_SelectedIndexChanged

but still nothing- Hide quoted text -

- Show quoted text -

Well, I got it... The OnDayRender happends after the PostBack events
are handled. It means you add a control which cannot be fired.
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top