hi there, i am trying to follow a tutorial from 4guysfromrolland
http://aspnet.4guysfromrolla.com/articles/030202-1.2.aspx
to make a calendar that inserts the date into the required field, everything is almost fine, just when i click on the date link it wont fill the data_text_field =/
this is the code in the form page:
<input name="admissionDate" type="text" class="style69" id="admissionDate" />
and this is the code on my calendar page:
<%@ Page Language="vb" %>
<script runat="server">
Private Sub Calendar1_SelectionChanged(sender As Object, e As EventArgs)
Dim strjscript as string = "<script language=""javascript"">"
strjscript &= "window.opener." & _
Httpcontext.Current.Request.Querystring("admissionDate") & ".value = '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug
Literal1.Text = strjscript 'Set the literal control's text to the JScript code
End Sub
Private Sub Calendar1_DayRender(sender As Object, e As DayRenderEventArgs)
If e.Day.Date = DateTime.Now.ToString("d") Then
e.Cell.BackColor = System.Drawing.Color.LightGray
End If
End Sub
</script>
<head>
<asp:Literal id="Literal1" runat="server"></asp:Literal>
<style type="text/css">
<!--
.style10 {font-size: small}
.style12 {font-size: small; color: #000066; }
.style16 {color: #333333; font-weight: bold; }
.style18 {font-size: small; color: #333333; }
.style20 {color: #6699FF; font-weight: bold; }
.style21 {color: #E2E2E2}
.style22 {color: #CCCCCC}
.style4 {color: #6699CC;
font-weight: bold;
}
.style6 {font-size: small;
font-weight: bold;
}
.style7 {font-size: large}
.style9 {color: #6699CC; font-weight: bold; font-size: small; }
body,td,th {
font-family: Verdana;
color: #6699FF;
}
a:link {
color: #6666CC;
}
a:visited {
color: #663399;
}
.style25 {
font-size: small;
color: #0066FF;
font-weight: bold;
}
body {
background-color: #F5F5F5;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
<html>
<body>
<form runat="server">
<asp:Calendar id="Calendar1" runat="server"
OnSelectionChanged="Calendar1_SelectionChanged"
OnDayRender="Calendar1_dayrender"
ShowTitle="true" DayNameFormat="FirstTwoLetters"
SelectionMode="Day" BackColor="#ffffff"
FirstDayOfWeek="Monday" BorderColor="#000000"
ForeColor="#00000" Height="60" Width="120">
<TitleStyle backcolor="#CCCCCC" forecolor="#ffffff" />
<NextPrevStyle backcolor="#CCCCCC" forecolor="#ffffff" />
<OtherMonthDayStyle forecolor="#6699FF" />
</asp:Calendar>
</form>
</html>
</body>
Any help is appreciated, thanks in advance.
:pirate: <-- sweet 