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.
|