Last post Nov 28, 2007 01:46 AM by Nai-Dong Jin - MSFT
Nov 26, 2007 02:17 AM|heinlwin|LINK
how to capture events for link button which is created in DayRender Event of Calendar Control?
right now, i am developing a customized event calendar control and i use asp.net calendar control and i want to put some link buttons (which will be created in dayrender event) in each day cell....
i can put link buttons by using controls.add() methods but i cannot capture even of corresponding control even i have assigned click event handler with related method.
if anyone who knows this... plase share your experience...
thanks a lot,
Nov 28, 2007 01:46 AM|Nai-Dong Jin - MSFT|LINK
Calendar's DayRender event occurs at render phase of the Page lifecycle, which is too late to add controls to the Page for postback events.
Maybe you are wondering if you can add LinkButtons to Controls collection before rendering, but actually, Calendar has EmptyControlCollection as the collection type which indicates that it won't allow child controls. You can try other buttons, although you
still can’t raise postback events, you can check Form post (request.Form) collection manually to see if the button was clicked.