Hello
pls check the the following code for calender page............
<%@ Page Language="c#" CodeBehind="calendar.aspx.cs" AutoEventWireup="false"
Inherits="WebApplication1.examples.calender" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<title>Choose a Date</title>
<script runat="server">
void Calendar1_SelectionChanged(Object sender, System.EventArgs e)
{
string strjscript = "<script language='javascript'>";
strjscript += "window.opener." +
HttpContext.Current.Request.QueryString["formname"];
strjscript += ".value = '" + Calendar1.SelectedDate.ToString("d") +
"';window.close();";
strjscript += "</script" + ">"; //Don't ask, tool bug.
Literal1.Text = strjscript;
}
void Calendar1_DayRender(Object source, DayRenderEventArgs e)
{
if (e.Day.Date.ToString("d") == DateTime.Now.ToString("d"))
{
e.Cell.BackColor = System.Drawing.Color.LightGray;
}
}
</script>
</HEAD>
<body leftmargin="5" topmargin="5">
<form runat="server">
<asp:Calendar id="Calendar1" runat="server"
OnSelectionChanged="Calendar1_SelectionChanged"
OnDayRender="Calendar1_DayRender"
showtitle="true" DayNameFormat="FirstTwoLetters" SelectionMode="Day"
BackColor="#ffffff" FirstDayOfWeek="Monday"
BorderColor="#000000" ForeColor="#00000" Height="60" Width="120">
<TodayDayStyle ForeColor="White" BackColor="#999999"></TodayDayStyle>
<DayStyle BackColor="#CCCCCC"></DayStyle>
<NextPrevStyle Font-Size="8pt" Font-Bold="True"
ForeColor="White"></NextPrevStyle>
<DayHeaderStyle Font-Size="8pt" Font-Bold="True" Height="8pt"
ForeColor="#333333"></DayHeaderStyle>
<SelectedDayStyle ForeColor="White" BackColor="#333399"></SelectedDayStyle>
<TitleStyle Font-Size="12pt" Font-Bold="True" Height="12pt"
ForeColor="White" BackColor="#333399"></TitleStyle>
<OtherMonthDayStyle ForeColor="#999999"></OtherMonthDayStyle>
</asp:Calendar>
<asp:Literal id="Literal1" runat="server"></asp:Literal>
</form>
</body>
</HTML>
rgds,
Arun
----- Original Message -----
From: "Tegest Tesfaye" <[EMAIL PROTECTED]>
To: "ASPNETQuestion" <[email protected]>
Sent: Wednesday, July 13, 2005 5:36 AM
Subject: [AspNetAnyQuestionIsOk] How to do a postback or submit a page in
Javascript. Please Help!!
>
> Hi,
>
> I have a form with textbox control and I populate the text box from a
> calander control which is next to the textbox. I am doing that by writing a
> code in HTML page
>
> <img src="../images/buttons/smallcalendar.gif" style="cursor:hand"
> onclick="window.open('../includes/calendarpopup.aspx?textbox=txtCompensationNonNonSecurity&Date='
> +
> txtCompensationNonNonSecurity.value,'cal','width=250,height=225,left=270,top=180')">
>
> So when the image is clicked this takes to the calander page and below is
> part the code in the code behind on the cacalnder page which is trigered when
> the date changes.. I want to be able to post back the original page under
> this event or be able to hit the text_changed event of the text box. How
> would I accompliah this ? What would be the javascript code I need to put to
> post back the page. I think it should come before self.close line.
>
>
>
>
>
> Protected Sub Change_Date(ByVal sender As System.Object, ByVal e As
> System.EventArgs)
>
> Dim strScript As String = "<script>window.opener.document.forms(0)." +
> control.Value + ".value = '"
>
> strScript += calDate.SelectedDate.ToString("MM/dd/yyyy")
>
> strScript += "';self.close()"
>
> strScript += "</" + "script>"
>
> RegisterClientScriptBlock("anything", strScript)
>
> End Sub
>
>
>
> Thanks Tegest
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/