473,387 Members | 1,440 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,387 software developers and data experts.

Problem with a Calendar control

First, let me start by saying my asp.net experience is still in it's
infancy so please bare with me as I try to explain my situation.

I have created a single page that with the use of many controls (i.e.
roundedcorners component [see www.4guysfromrolla.com], buttons and
panels) functions like a tab control. The buttons are programmatically
designed to make the corresponding panel visible.

Sample aspx.vb code:

Private Sub btnEvent_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnEvent.Click

pnlEvent.Visible = True
pnlHotel.Visible = False
pnlTravel.Visible = False
pnlPerDiem.Visible = False
pnlOther.Visible = False

End Sub

Private Sub btnHotel_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnHotel.Click

pnlHotel.Visible = True
If chkhSpouse.Checked = True Then
pnlSpouseData.Visible = True
Else
pnlSpouseData.Visible = False
End If

If chkhCCHold.Checked = True Then
txthCCHoldAmt.Visible = True
lblhCCHoldAmt.Visible = True
Else
txthCCHoldAmt.Visible = False
lblhCCHoldAmt.Visible = False
End If
pnlTravel.Visible = False
pnlPerDiem.Visible = False
pnlOther.Visible = False
pnlEvent.Visible = False

End Sub

Private Sub btnTravel_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnTravel.Click

pnlEvent.Visible = False
pnlHotel.Visible = False
pnlTravel.Visible = True
pnlPerDiem.Visible = False
pnlOther.Visible = False

End Sub

Private Sub btnPerDiem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnPerDiem.Click

pnlEvent.Visible = False
pnlHotel.Visible = False
pnlTravel.Visible = False
pnlPerDiem.Visible = True
pnlOther.Visible = False

End Sub

Private Sub btnOther_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnOther.Click

pnlEvent.Visible = False
pnlHotel.Visible = False
pnlTravel.Visible = False
pnlPerDiem.Visible = False
pnlOther.Visible = True

End Sub

On each of these panels there are buttons that link to a calendar
control (Calendar.aspx). Each button passes a textbox name to the
calendar control so that when a date is selected this value is passed
back to the corresponding text box.

Sample Button HTML Code:

<SPAN id="calBlock1"><A
href="javascript:calendar_window=window.open('//localhost/advtravel/calendar.aspx?

formname=AdminBooking.txteStartDt','calendar_windo w','width=230,height=230');calendar_window.focus() "><IMG
id="eStartDtCal" height="22" alt="Choose an event start date"
src="images/calendar.gif" align="absMiddle" border="0"></A></SPAN>

Sample Calendar.aspx HTML:

<%@ Register TagPrefix="cc1" Namespace="PrettyUI" Assembly="PrettyUI"
%>
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Calendar.aspx.vb" smartnavigation="true"
Inherits="AdvTravel.Calendar" %>
<HTML>
<HEAD>
<title>Select a date</title>
<script runat="server">
Private Sub cntCalendar_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cntCalendar.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript = strjscript & "window.opener." &
HttpContext.Current.Request.QueryString("formname" ) & ".value = '" &
cntCalendar.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug
Literal1.Text = strjscript

End Sub
</script>
<asp:literal id="Literal1" Runat="server"></asp:literal>
<LINK href="http://localhost/AdvTravel/CSS/calendar.css"
type="text/css" rel="stylesheet">
</HEAD>
<BODY bgcolor="silver">
<form id="frmCalendar" runat="server">
<cc1:roundedcorners id="RoundedCorners1" runat="server"
Width="210px" BorderColor="Navy" BorderStyle="Solid"
BorderWidth="2px" CornerHeight="20px" CornerWidth="20px"
Height="210px" BackColor="WhiteSmoke">
<TABLE cellSpacing="0" cellPadding="0">
<TR>
<TD height="13">
<asp:dropdownlist id="drpCalMonth" Runat="Server" Width="100px"
CssClass="calTitle" OnSelectedIndexChanged="Set_Calendar"
AutoPostBack="True"></asp:dropdownlist>
<asp:dropdownlist id="drpCalYear" Runat="Server" Width="60px"
CssClass="calTitle" OnSelectedIndexChanged="Set_Calendar"
AutoPostBack="True"></asp:dropdownlist></TD>
</TR>
<TR>
<TD>
<asp:calendar id="cntCalendar" Runat="Server" Width="100%"
CssClass="calbody" ondayrender="Calendar_dayrender"
ShowTitle="True"
OnSelectionChanged="cntCalendar_SelectionChanged"
OtherMonthDayStyle-BackColor="White"
DayStyle-BackColor="LightYellow"></asp:calendar></TD>
</TR>
</TABLE>
</cc1:roundedcorners></form>
</BODY>
</HTML>

This functionality works well on the first visible panel on the page
however, soon as I click on a new "tab" to make a different panel
visible the the calendar functionality no longer works. The calendar
will pop-up but when a date is selected the calendar.aspx pop-up does
not close and does not write the value back to the corresponding text
field.

NOTE: There is a animated .gif on the page that also hangs when the
javascript fails.

I must conclude with first, an apology for the long-winded explaination
to my problem and second, a thank you in advance to anyone willing to
assist a newbie in trying to find a fix to this problem.

Nov 18 '05 #1
0 1707

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

Similar topics

9
by: Matt Tapia | last post by:
I having a problem that receives the following error: Specified cast is not valid And I need some help. Here is what is happening: I have a form with a drop-down control that contains a list...
2
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many...
7
by: Martijn Saly | last post by:
Hi there, I've created a master page with some controls on it, a Calendar control among others. Now depending on the date(s) selected, the content page needs to be updated. In the masterpage...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I am using a calendar extender with a masked edit validator and masked editextender that provides a dropdown calendar and a text box for date entry. On the same page I am using a sliderExtender...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.