Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using Calendar as a popup

Reply
Thread Tools

Using Calendar as a popup

 
 
Merex
Guest
Posts: n/a
 
      08-07-2003
Hello all,

I want to use the Calendar control as a popup window. I would like
each day's link to execute some javascript which would set the value
of a textbox on the window which opened the calendar and then close
the calendar window. So basically I want to customize the <A> tag for
each date to call my custom JavaScript function.

function SelectedDate(strDate) {
window.opener.document.forms["frmMain"].elements["txtDate"].value =
strDate;
}

Can anyone point me in the right direction. I am thinking that I
might be able to hook into some event that the calendar generates...

Thanks,
Ross
 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      08-07-2003
Merex,

I'm not certain if you can easily hook this up to the calendar itself so
that it all executes client side. How about using the body tag a server
control and placing your script into its onload event. Doing so would
require that the calendar post back when a value is selected but it would
then function exactly as you are attempting.

If you decide to go this route I have some sample code in the code library
of my site, www.aboutfortunate.com, that shows how to use the body tag as a
server control. Just search the code library for: "use the body tag as a
server control" or something similar.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche


"Merex" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hello all,
>
> I want to use the Calendar control as a popup window. I would like
> each day's link to execute some javascript which would set the value
> of a textbox on the window which opened the calendar and then close
> the calendar window. So basically I want to customize the <A> tag for
> each date to call my custom JavaScript function.
>
> function SelectedDate(strDate) {
> window.opener.document.forms["frmMain"].elements["txtDate"].value =
> strDate;
> }
>
> Can anyone point me in the right direction. I am thinking that I
> might be able to hook into some event that the calendar generates...
>
> Thanks,
> Ross



 
Reply With Quote
 
 
 
 
Ravikanth[MVP]
Guest
Posts: n/a
 
      08-07-2003
Hi

Check out this may help you.

http://www.excentricsworld.com/customcontrols.aspx?id=7

Ravikanth[MVP]


>-----Original Message-----
>Hello all,
>
>I want to use the Calendar control as a popup window. I

would like
>each day's link to execute some javascript which would

set the value
>of a textbox on the window which opened the calendar and

then close
>the calendar window. So basically I want to customize

the <A> tag for
>each date to call my custom JavaScript function.
>
>function SelectedDate(strDate) {
> window.opener.document.forms["frmMain"].elements

["txtDate"].value =
>strDate;
>}
>
>Can anyone point me in the right direction. I am

thinking that I
>might be able to hook into some event that the calendar

generates...
>
>Thanks,
>Ross
>.
>

 
Reply With Quote
 
jayuya
Guest
Posts: n/a
 
      08-07-2003
Ross,
There was a posting related to this about 3 or 6 weeks
ago. Search for calendar control or popups. The code
sample was posted by savarana from Miscrosoft india, she
has a really good sample code of what you are looking for.
I think she implemented a custom coontrol to do so. If not
I will email again as soon as I find the web link of it.
but if you find it posted again so that we can all have
the link to the sample calendar control..

thanks,
jayuya



>-----Original Message-----
>Hello all,
>
>I want to use the Calendar control as a popup window. I

would like
>each day's link to execute some javascript which would

set the value
>of a textbox on the window which opened the calendar and

then close
>the calendar window. So basically I want to customize

the <A> tag for
>each date to call my custom JavaScript function.
>
>function SelectedDate(strDate) {
> window.opener.document.forms["frmMain"].elements

["txtDate"].value =
>strDate;
>}
>
>Can anyone point me in the right direction. I am

thinking that I
>might be able to hook into some event that the calendar

generates...
>
>Thanks,
>Ross
>.
>

 
Reply With Quote
 
Saravana
Guest
Posts: n/a
 
      08-08-2003
Check out this article ( this was the article mentioned by jayuya)
http://www.microsoft.com/india/msdn/...ndarinASP.aspx
or
www.extremeexperts.com/net/articles (For more articles on .NET)

--
Saravana
Microsoft India Community Star,MC**
www.extremeexperts.com



"jayuya" <(E-Mail Removed)> wrote in message
news:0c9901c35d08$be2fefc0$(E-Mail Removed)...
> Ross,
> There was a posting related to this about 3 or 6 weeks
> ago. Search for calendar control or popups. The code
> sample was posted by savarana from Miscrosoft india, she
> has a really good sample code of what you are looking for.
> I think she implemented a custom coontrol to do so. If not
> I will email again as soon as I find the web link of it.
> but if you find it posted again so that we can all have
> the link to the sample calendar control..
>
> thanks,
> jayuya
>
>
>
> >-----Original Message-----
> >Hello all,
> >
> >I want to use the Calendar control as a popup window. I

> would like
> >each day's link to execute some javascript which would

> set the value
> >of a textbox on the window which opened the calendar and

> then close
> >the calendar window. So basically I want to customize

> the <A> tag for
> >each date to call my custom JavaScript function.
> >
> >function SelectedDate(strDate) {
> > window.opener.document.forms["frmMain"].elements

> ["txtDate"].value =
> >strDate;
> >}
> >
> >Can anyone point me in the right direction. I am

> thinking that I
> >might be able to hook into some event that the calendar

> generates...
> >
> >Thanks,
> >Ross
> >.
> >



 
Reply With Quote
 
Merex
Guest
Posts: n/a
 
      08-11-2003
Thanks for all the replys. I made it work not long after posting
this.

protected void onDayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e) {
DateTime dtDate = e.Day.Date;
e.Cell.Controls.Clear();

HtmlAnchor anchor = new HtmlAnchor();
anchor.HRef="Javascript:SelectDate('"+dtDate.ToStr ing("MM/dd/yyyy")+"')";
anchor.InnerHtml = Convert.ToString(dtDate.Day);
e.Cell.Controls.Add(anchor);
}

Thanks,
Ross
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Synchronise Hotmail Calendar with Standard Outlook Calendar using Outlook Connector ?? Synapse Syndrome Computer Support 0 12-02-2007 04:19 AM
popup calendar when using Masterpage =?Utf-8?B?QWxp?= ASP .Net 6 05-28-2007 02:22 AM
Calendar popup - using ASP textbox instead of HTML textbox =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 03-30-2005 06:02 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Javascript PopUp using Calendar Control Stephajn Craig ASP .Net 3 07-23-2003 01:40 PM



Advertisments