473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JingleBEV | last post by:
Hi all, I have a masked text control that would return a date in string format via the mask property like: "9/23/2004" and i have a calendar control that would pop up when I click a command...
1
by: MLH | last post by:
I have code below in the OnUpdated property setting for the ActiveX control. However, when I left click a new date on the calendar in an open form, the code does not run (IE, msgbox does not...
5
by: Miguel Dias Moura | last post by:
Hello, i am trying to create a .css file with several styles and apply them to the calendar control so i can change the look of: 1. Text Type and Format (Bold, Underline, etc) 2. Background...
27
by: Dino M. Buljubasic | last post by:
I'd like to build a calendar displaying all days in a month in a grid so that when I click on the header of a square representing a day of month, I can add a new meeting etc. I know that .net...
3
by: Peter | last post by:
Is there anyway to make the System.Web.UI.WebControls.Calendar to display only Month Name and Year, like: January, 2006 February, 2006 ..... .... .... ....
6
by: Mike9900 | last post by:
Hello, I want to view the calendar in another culture, for example let it show in Arabic. I use this code in the Main, but the calendar is still in the same culture: CultureInfo sa = new...
6
by: thorpk | last post by:
I have an access database that i have added a pop up calendar to, the Table information for the Date Reported field is Date/Time format short date, input mask is 00/00/0000. i have created a...
3
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.