473,225 Members | 308 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,225 software developers and data experts.

2.0: implementing popup Calendar

Hello,
I need to implement popup calendar in ASP.NET application. I created a
button opening popup calendar on 'master' page:

<asp:Button ID="Calendar" runat="server"
Text=Calendar" OnClientClick=
"window.open('Calendar.aspx', 'Calendar',
'menubar=no, location=no, personalbar=no, status=no, resizable=no,
scrollbars=no, width=200, height=200');" />

Here is Calendar.aspx:

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Calendar.aspx.cs" Inherits="CalendarPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
<head runat="server">
<title>Calendar</title>
<link rel="Stylesheet" type="text/css" href="Styles.css" />
</head>
<body class="WithBackground">
<form id="Demo" runat="server">
<asp:Calendar ID="Calendar" runat="server"
OnSelectionChanged="Calendar_SelectionChanged" />
</form>
</body>
</html>

And here is Calendar.aspx.cs:

public partial class CalendarPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Calendar.Attributes.Add("ondblclick", "window.close();");
// NOTE 1: this way I wanted to achieve auto closing of
// calendar window on double click of date; it doesn't work
}
protected void Calendar_SelectionChanged(object sender,
EventArgs e)
{
Cache["BirthDate"] =
Calendar.SelectedDate.ToString().Substring(0, 10);
// NOTE 2: how to transfer this value to 'master' page
// (to be visible WITHOUT refresh)?
}
}

Could you suggest me a solution to the problems described in NOTE 1
and NOTE 2?
Thank you vey much!
/RAM/
Jun 8 '06 #1
1 2713
I am working on one for sale for like $20 if you are interested
http://www.actieve.com/CalendarControl.aspx .Net 2.0 and Javascript with tons
of options, Otherwise I used to do it this way where I would call in
javascript something like this is a onPostback RegisterClientScript

winodw.opener.getElementById('dateifeld').value = '<%= calendar.SelectedDate
%>';
window.close();

"R.A.M." wrote:
Hello,
I need to implement popup calendar in ASP.NET application. I created a
button opening popup calendar on 'master' page:

<asp:Button ID="Calendar" runat="server"
Text=Calendar" OnClientClick=
"window.open('Calendar.aspx', 'Calendar',
'menubar=no, location=no, personalbar=no, status=no, resizable=no,
scrollbars=no, width=200, height=200');" />

Here is Calendar.aspx:

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Calendar.aspx.cs" Inherits="CalendarPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
<head runat="server">
<title>Calendar</title>
<link rel="Stylesheet" type="text/css" href="Styles.css" />
</head>
<body class="WithBackground">
<form id="Demo" runat="server">
<asp:Calendar ID="Calendar" runat="server"
OnSelectionChanged="Calendar_SelectionChanged" />
</form>
</body>
</html>

And here is Calendar.aspx.cs:

public partial class CalendarPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Calendar.Attributes.Add("ondblclick", "window.close();");
// NOTE 1: this way I wanted to achieve auto closing of
// calendar window on double click of date; it doesn't work
}
protected void Calendar_SelectionChanged(object sender,
EventArgs e)
{
Cache["BirthDate"] =
Calendar.SelectedDate.ToString().Substring(0, 10);
// NOTE 2: how to transfer this value to 'master' page
// (to be visible WITHOUT refresh)?
}
}

Could you suggest me a solution to the problems described in NOTE 1
and NOTE 2?
Thank you vey much!
/RAM/

Jun 8 '06 #2

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

Similar topics

4
by: Ali | last post by:
i am using visual studio 2005 and I am trying to create a popup calender so when a user click on a image on the main form, a calender will then popup, the user will select a date and the date will...
3
by: Peter | last post by:
Does anyone have an example of how you would do a popup window when a user clicks on a day number link in the ASP.NET Web Calendar control? I am trying to create an event calendar similar to how...
1
by: Garth Wells | last post by:
I found sample code that shows me how to implement a popup calendar, but I would like the calendar to popup at the lower right of the Input to which it's associated...the way Sharepoint popup...
4
by: TristaSD | last post by:
Hi, I'm trying to add a calendar to my html text box similar to ones you can find on practically every travel site. A user clicks on the text box, the calendar comes up, the user clicks on a...
0
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar"...
0
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error:...
5
by: rockdale | last post by:
Hi, I tried to search web for an non-popup calendar control, (like javascript calendar) but could not find a good solution. Most solutions are popup another window and show the calendar, then...
4
by: ShyGuy | last post by:
A while back I had found a link to a popup calendar that had a small button that was placed to the right of any text box. By clicking on the icon and selecting a date the text box was updated with...
3
by: mikaint | last post by:
I'm really confused here...i'll need some help with the following... i have a sceipt that will open a popup win which is actually a calendar and i'm trying to apply a style on the popup... Here's...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.