Hi Brian,
I'm not sure what you need to accomplish, but you seem to need to look up
additional information based on the date. Perhaps you can provide more info?
In the meantime, I've pasted in a little code that might get you started
towards something....
Ken
Microsoft MVP [ASP.NET]
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Calendar1_SelectionChanged _
(ByVal sender As Object, ByVal e As System.EventArgs)
TextBox1.Text = _
GetAdditionalData(Calendar1.SelectedDate)
End Sub
Function GetAdditionalData _
(ByVal selDate As DateTime) As String
If selDate.DayOfWeek = DayOfWeek.Saturday Or _
selDate.DayOfWeek = DayOfWeek.Sunday Then
Return "Weekend Date: " & _
selDate.ToLongDateString
Else
Return "Week day Date: " & _
selDate.ToLongDateString
End If
End Function
</script>
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Calendar Value in a Textbox</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:calendar id="Calendar1" runat="server"
onselectionchanged="Calendar1_SelectionChanged"></asp:calendar>
<br />
<asp:textbox id="TextBox1" runat="server"
width="300px"></asp:textbox> </div>
</form>
</body>
</html>
Hello,
I have a calendar and a textbox right below it on my webpage. I need
help with creating some code to display information about the date the
user clicked in the text box below it.
For example, they clock on August 13th, and in texbox1, it will say
"Wedding, 2:00 PM".
How do I get started?
Thanks,
Brian