Calendar control returning wrong format

G

GFro

I have a calendar page that returns a date to a textbox on the parent
page. It is returning the wrong format on the deployment server. On
the development server the calendar returns to textbox in the
mm/dd/yyyy format. I created a deployment package and installed the
program on another server and it also returned the correct mm/dd/yyyy
format. Recently I got complaints saying that the format changed to
mm-dd-yyyy format. This mm-dd-yyyy format is invalid and I throw an
error messsage to the user.

Has anything changed on Windows 2000 recently that could have affected
this? I'm guessing this problem started a week or two ago. IT still
works fine on the development server.



I have attached the code below for the calendar and the icon that
calls the calendar below. Any help would greatly be appreciated.







Here is the code for the calendar page.


<%@ Page language="c#" Codebehind="Calendar.aspx.cs"
AutoEventWireup="false" Inherits="WCMS.Calendar" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Calendar</title>
<script runat="server">

private void Calendar1_SelectionChanged(object sender,
System.EventArgs e)
{
string strjscript = "<script language=javascript>";
strjscript = strjscript + "window.opener." +
HttpContext.Current.Request.QueryString["FormName"] + ".value = '" +
Calendar1.SelectedDate.ToString("MM/dd/yyyy") + "';window.close();";
strjscript = strjscript + "</script" + ">";

Literal1.Text = strjscript;

}
private void Calendar1_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)
{
if (e.Day.Date == DateTime.Today)
{
e.Cell.BackColor = System.Drawing.Color.LightGray;
}

}

</script>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Calendar" method="post" runat="server">
<asp:calendar id="Calendar1" Width="120"
OnDayRender="Calendar1_DayRender"
OnSelectionChanged="Calendar1_SelectionChanged" Height="60"
ForeColor="#000080" BorderColor="#000000" FirstDayOfWeek="Monday"
BackColor="#ffffff" SelectionMode="Day"
DayNameFormat="FirstTwoLetters" ShowTitle="True" Runat="server">
<TitleStyle BackColor="#000080" ForeColor="#ffffff" />
<NextPrevStyle BackColor="#000080" ForeColor="#ffffff" />
<OtherMonthDayStyle ForeColor="#c0c0c0" />
</asp:calendar><BR>
<asp:Literal ID="Literal1" Runat="server"></asp:Literal>
</form>
</body>
</HTML>

Here is the code that calls the calendar page.

<A id="A1" style="Z-INDEX: 165; LEFT: 608px; POSITION: absolute; TOP:
251px" href="javascript:calendar_window=window.open('/WCMS/calendar.aspx?formname=Form1.oshipdate_box','calendar_window','width=173,height=208');calendar_window.focus()"
runat="server">
<IMG id="cal1" height="16" src="/WCMS/icon-calendar.gif"
width="24" border="0" runat="server"></A>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top