私はタイムトラッカーとして使用しているasp.netカレンダーを持っています。現在、私は必要な情報でカレンダーにデータを入力するmysqlクエリを持っていますが、日の1つが選択されたときにこの情報を取得する方法はわかりません。ユーザーが日付を選択すると、その日の情報を取得し、カップルのラベルを入力したいと考えています。カレンダーコードは次のとおりです。ありがとう。asp.netカレンダーのハイパーリンクの使用
If Not dsDate Is Nothing Then
For Each dr As DataRow In dsDate.Tables(0).Rows
description = CType(dr("Description"), String)
nextDate = CType(dr("Date"), DateTime)
hours = CType(dr("Hours"), Integer)
If nextDate = e.Day.Date And description = "Sick" Then
e.Cell.BackColor = System.Drawing.Color.DarkGreen
e.Cell.ToolTip = description & " - " & hours & " Hours"
ElseIf nextDate = e.Day.Date And description = "Vacation" Then
e.Cell.BackColor = System.Drawing.Color.Brown
e.Cell.ToolTip = description & " - " & hours & " Hours"
End If
Next
End If
If e.Day.IsWeekend Then
e.Cell.BackColor = System.Drawing.Color.LightSkyBlue
e.Day.IsSelectable = False
End If
If nottouched And Not e.Day.IsWeekend And Not e.Cell.BackColor = System.Drawing.Color.DarkGreen And Not e.Day.IsOtherMonth And Not e.Cell.BackColor = System.Drawing.Color.Brown Then
e.Cell.Attributes.Add("onmouseover", onmouseoverStyle)
e.Cell.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor))
End If
「日付から情報を取得する」とは、選択した日付自体を正確に意味しますか? – R3D3vil
選択した日付と、その日付のツールチップに追加した情報をページのカップルのラベルに追加します。あるいは、日付がクリックされたときに、より簡単な場合は、mysqlに対してクエリを実行して、ラベルを設定します。 基本的に、日付がクリックされたときに何が起こっているのかわかりません!私はこのことを初めて知っています。 –