469,892 Members | 2,171 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,892 developers. It's quick & easy.

Calendar control returning wrong format

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" >
<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;


<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"
<form id="Calendar" method="post" runat="server">
<asp:calendar id="Calendar1" Width="120"
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:Literal ID="Literal1" Runat="server"></asp:Literal>

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','calen dar_window','width=173,height=208');calendar_windo w.focus()"
<IMG id="cal1" height="16" src="/WCMS/icon-calendar.gif"
width="24" border="0" runat="server"></A>
Nov 18 '05 #1
0 1347

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Miguel Dias Moura | last post: by
27 posts views Thread by Dino M. Buljubasic | last post: by
3 posts views Thread by Peter | last post: by
6 posts views Thread by thorpk | last post: by
3 posts views Thread by thorpk | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.