Originariamente inviato da djciko
non devi passare nulla credo, il mese è quello in rendering :master:
oppure non ho capito bene...
Ecco il codice che ho nella sub:
codice:
Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
connetti()
Try
Dim link As New HyperLink()
Dim instance As DateTime
Dim mese As String
instance = Date.Today
mese = instance.Month
strsql = "Select * From Eventi where mese=" & mese
cmdSql = New OleDbCommand(strsql, conn)
rs = cmdSql.ExecuteReader()
While rs.Read()
If (e.Day.Date.Day = rs("giorno")) Then
' cambio colore di sfondo per giorni = 15
e.Cell.BackColor = System.Drawing.Color.Orange
e.Cell.ForeColor = System.Drawing.Color.White
link.Text = e.Day.DayNumberText
link.NavigateUrl = "evento.aspx?id_evento=" & rs("id_evento")
e.Cell.Text = ""
e.Cell.Controls.Add(link)
End If
End While
rs.Close()
Catch errore As Exception
messaggio.Text = "Si è verificato il seguente errore: " & errore.Message
Finally
conn.Close()
End Try
End Sub
a me dovrebbe cambiare la variabile "mese"