thanx for the replay. but i still have a problem. there
is nothing wrong with ur code. i tried and tested ur code
and it works fine. however, i am creating the button
inside the content of an asp:calendar. look at the code
below:

If d.IsOtherMonth Then
c.Controls.Clear
Else
Try
If e.Day.Date = "8/25/2003" Then
Dim b As New Button
b.text = "hello"
AddHandler b.Click, AddressOf Text
e.Cell.Controls.Add(b)
e.Cell.Controls.Add(New LiteralControl("hello"))
End If
Catch exc As Exception
Response.Write(exc.ToString())
End Try
End If
End Sub

Ok, first let me say that I do very little ASP.NET, mostly WinForms. So this
might not be the best solution. But after some investigation into your
problem this is what I have concluded.

When adding the controls dynamically the events must be wired in the
Page_Load since the events are fired then. If it is only done when your Cell
is rendered, the ASP.NET event firing has already been done so it is to
late. Additionally the control must belong to a control collection before
the events are fired. With this in mind, my solution entailed placing a
PlaceHolder on the page. Then in the Page_Load event I created the button,
added it to the PlaceHolder controls collection and wired the event. After
this the events Fire. Then in the Page_PreRender event I clear the
PlaceHolder controls collection, this prevents the control actually showing
in the PlaceHolder. In the DayRender I added the Button to the Cells control
collection causing the Button to appear in the correct place. I hope this
helps and I really hope there is a better solution!

See Code Below

NB: I changed the date format to work on my locale, so you will have to
change that!!!

If d.IsOtherMonth Then
c.Controls.Clear
Else
Try
If e.Day.Date = DateTime.Parse("25/8/2003") Then
e.Cell.Controls.Add(b)
End If
Catch exc As Exception
Response.Write(exc.ToString())
End Try
End If
End Sub