R
R.A.M.
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/
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/