473,735 Members | 10,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y
designed to make the corresponding panel visible.

Sample aspx.vb code:

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

pnlEvent.Visibl e = True
pnlHotel.Visibl e = False
pnlTravel.Visib le = False
pnlPerDiem.Visi ble = False
pnlOther.Visibl e = False

End Sub

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

pnlHotel.Visibl e = True
If chkhSpouse.Chec ked = True Then
pnlSpouseData.V isible = True
Else
pnlSpouseData.V isible = False
End If

If chkhCCHold.Chec ked = True Then
txthCCHoldAmt.V isible = True
lblhCCHoldAmt.V isible = True
Else
txthCCHoldAmt.V isible = False
lblhCCHoldAmt.V isible = False
End If
pnlTravel.Visib le = False
pnlPerDiem.Visi ble = False
pnlOther.Visibl e = False
pnlEvent.Visibl e = False

End Sub

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

pnlEvent.Visibl e = False
pnlHotel.Visibl e = False
pnlTravel.Visib le = True
pnlPerDiem.Visi ble = False
pnlOther.Visibl e = False

End Sub

Private Sub btnPerDiem_Clic k(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnPerDiem.Clic k

pnlEvent.Visibl e = False
pnlHotel.Visibl e = False
pnlTravel.Visib le = False
pnlPerDiem.Visi ble = True
pnlOther.Visibl e = False

End Sub

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

pnlEvent.Visibl e = False
pnlHotel.Visibl e = False
pnlTravel.Visib le = False
pnlPerDiem.Visi ble = False
pnlOther.Visibl e = 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="javascrip t:calendar_wind ow=window.open( '//localhost/advtravel/calendar.aspx?

formname=AdminB ooking.txteStar tDt','calendar_ window','width= 230,height=230' );calendar_wind ow.focus()"><IM G
id="eStartDtCal " height="22" alt="Choose an event start date"
src="images/calendar.gif" align="absMiddl e" border="0"></A></SPAN>

Sample Calendar.aspx HTML:

<%@ Register TagPrefix="cc1" Namespace="Pret tyUI" Assembly="Prett yUI"
%>
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Cal endar.aspx.vb" smartnavigation ="true"
Inherits="AdvTr avel.Calendar" %>
<HTML>
<HEAD>
<title>Select a date</title>
<script runat="server">
Private Sub cntCalendar_Sel ectionChanged(B yVal sender As System.Object,
ByVal e As System.EventArg s) Handles cntCalendar.Sel ectionChanged
Dim strjscript As String = "<script language=""java script"">"
strjscript = strjscript & "window.opener. " &
HttpContext.Cur rent.Request.Qu eryString("form name") & ".value = '" &
cntCalendar.Sel ectedDate & "';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:roundedcor ners id="RoundedCorn ers1" runat="server"
Width="210px" BorderColor="Na vy" BorderStyle="So lid"
BorderWidth="2p x" CornerHeight="2 0px" CornerWidth="20 px"
Height="210px" BackColor="Whit eSmoke">
<TABLE cellSpacing="0" cellPadding="0" >
<TR>
<TD height="13">
<asp:dropdownli st id="drpCalMonth " Runat="Server" Width="100px"
CssClass="calTi tle" OnSelectedIndex Changed="Set_Ca lendar"
AutoPostBack="T rue"></asp:dropdownlis t>
<asp:dropdownli st id="drpCalYear " Runat="Server" Width="60px"
CssClass="calTi tle" OnSelectedIndex Changed="Set_Ca lendar"
AutoPostBack="T rue"></asp:dropdownlis t></TD>
</TR>
<TR>
<TD>
<asp:calendar id="cntCalendar " Runat="Server" Width="100%"
CssClass="calbo dy" ondayrender="Ca lendar_dayrende r"
ShowTitle="True "
OnSelectionChan ged="cntCalenda r_SelectionChan ged"
OtherMonthDaySt yle-BackColor="Whit e"
DayStyle-BackColor="Ligh tYellow"></asp:calendar></TD>
</TR>
</TABLE>
</cc1:roundedcorn ers></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 1745

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

Similar topics

9
2153
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 of control names (TextBox, DropDownList, Calendar). On Post back of this drop-down control, I clear a panel control (I have on the same page) of all its controls, then dymamically add the selected control to the panel. For example, if in ddl
2
3413
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 controls (i.e. roundedcorners component 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:
7
1956
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 I've created StartDate and EndDate properties, which are basically wrappers around the SelectedDates property from the Calendar control. When I select another date in the Calendar, the page updates normally, but when Page_Load for the content page...
2
1834
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 control. Both controls work but the problem is that the slider is placed below the calendar extender so when the user clicks on the calendar image and the calendar appears, the slider control appears mixed in with the calendar control where it...
0
9463
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9327
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9251
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6049
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4559
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4822
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3273
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2739
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.