Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Popup Calendar Issue

Reply
Thread Tools

Popup Calendar Issue

 
 
IntraRELY
Guest
Posts: n/a
 
      04-06-2007
When I click the next or previous month in the Calendar control the Calendar
disapprears. I assume this is due to the post back. This is the expected and
needed behavior when you click a day. However, when you are changing
months, you are not selecting a date, so you have to click the Calendar
Popup link again and it will be on the previous/next, which ever you
clicked, month so you can select the date you require.

I need a way to sort through the months, w/o it closing. Any ideas?

Thanks,

Steve

------------------------------------------------------------------------
----------------------------Problem Prototype-------------------------
------------------------------------------------------------------------

<%@ Page Language="VB" %>
<script runat="server">
</script>
<head runat="server">
<script type="text/javascript">
function displayCalendarBegin(cal)
{
var datePicker = document.getElementById(cal);
datePicker.style.display = 'block';
}
</script>
<style type="text/css">
.calStyle
{
display:none;
position:absolute;
border:solid 2px black;
background-color:White;
}
</style>
<title>Calendar Test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Time Entry</h3>
<div class =calStyle ID=calBegin>
<asp:Calendar ID="calStartDateTimeBegin" runat="server"
ToolTip="Select begin date to view hours." />
</div>
<img src="App_Themes/DefaultTheme/Images/CalendarLink.jpg"
onclick="displayCalendarBegin('calBegin')" />
</div>
</form>
</body>
</html>


 
Reply With Quote
 
 
 
 
marss
Guest
Posts: n/a
 
      04-06-2007

IntraRELY wrote:
> When I click the next or previous month in the Calendar control the Calendar
> disapprears. I assume this is due to the post back. This is the expected and
> needed behavior when you click a day. However, when you are changing
> months, you are not selecting a date, so you have to click the Calendar
> Popup link again and it will be on the previous/next, which ever you
> clicked, month so you can select the date you require.
>
> I need a way to sort through the months, w/o it closing. Any ideas?
>
> Thanks,
>
> Steve
>
> ------------------------------------------------------------------------
> ----------------------------Problem Prototype-------------------------
> ------------------------------------------------------------------------
>
> <%@ Page Language="VB" %>
> <script runat="server">
> </script>
> <head runat="server">
> <script type="text/javascript">
> function displayCalendarBegin(cal)
> {
> var datePicker = document.getElementById(cal);
> datePicker.style.display = 'block';
> }
> </script>
> <style type="text/css">
> .calStyle
> {
> display:none;
> position:absolute;
> border:solid 2px black;
> background-color:White;
> }
> </style>
> <title>Calendar Test</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> <h3>Time Entry</h3>
> <div class =calStyle ID=calBegin>
> <asp:Calendar ID="calStartDateTimeBegin" runat="server"
> ToolTip="Select begin date to view hours." />
> </div>
> <img src="App_Themes/DefaultTheme/Images/CalendarLink.jpg"
> onclick="displayCalendarBegin('calBegin')" />
> </div>
> </form>
> </body>
> </html>


The most of the changes that is made by the means of client-side
JavaScript do not post to the server.
You should pass the changes to the server manually and correct the
state of your Popup Calendar. For example:

Html:

.....
function displayCalendarBegin(cal)
{
var datePicker = document.getElementById(cal);
datePicker.style.display = 'block';
//save the changes to hidden field
document.getElementById('hidCalendarVisibility').v alue = 'block';
}
.....
<div class =calStyle ID=calBegin runat=server> //add runat="server"
attribute
.......
//add hidden field to store the changes
<input type=hidden id="hidCalendarVisibility" runat=server />
.....

Code: (C#, but I think you will understand)
protected void Page_Load(object sender, EventArgs e)
{
calBegin.Style["display"] = hidCalendarVisibility.Value;
}
Maybe it helps.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar GadGets does not show calendar iccsi Windows 64bit 4 08-14-2011 01:52 PM
How to Synchronise Hotmail Calendar with Standard Outlook Calendar using Outlook Connector ?? Synapse Syndrome Computer Support 0 12-02-2007 04:19 AM
Thunderbird Calendar with Exchange 2003 Calendar and Public FoldersCalendar jincmcse Firefox 1 09-03-2005 02:46 AM
Calendar Control - Programatically set the calendar to a date range Shevek ASP .Net 3 06-23-2004 01:41 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57