Clear-RCIC,
There is nothing in the ASPX page (let say the template) and it is therefore
by every visit build new. What you want can you do by instance like this.
\\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If CBool(Session.Item("set")) Then
Button1_Click(Nothing, Nothing)
End If
End Sub
Private Sub mybutton_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mylabel As New Label
Me.Panel1.Controls.Add(New LiteralControl("<BR><BR>"))
Me.Panel1.Controls.Add(mylabel)
mylabel.Text = "The day is: " & DirectCast(sender, Button).Text
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim mybutton As Button
Dim i As Integer
For i = 0 To New Date().DaysInMonth _
(New Date().Year, New Date().Month) - 1
Session.Item("set") = True
mybutton = New Button
mybutton.BackColor = Drawing.Color.White
mybutton.Text = (i + 1).ToString
mybutton.Width = New Unit(30)
Me.Panel1.Controls.Add(mybutton)
AddHandler mybutton.Click, AddressOf mybutton_Click
If (i + 1) Mod 5 = 0 Then
Me.Panel1.Controls.Add(New LiteralControl("<BR>"))
End If
Next
Button1.Visible = False
End Sub
///
I hope this helps,
Cor