By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,131 Members | 1,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,131 IT Pros & Developers. It's quick & easy.

2.0: implementing popup Calendar

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.