Using Calendar as a popup

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Using Calendar as a popup

    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
    Merex Guest

  2. Similar Questions and Discussions

    1. 2006 calendar needed for photo calendar
      I want to start work on a 2006 calendar featuring my own photographs. In Photoshop there used to be a calendar-creating feature that worked well,...
    2. Javascript PopUp using Calendar Control
      How can I implement the Calendar Control in a popup Window so that when a user selects a date that the selected date is passed into a textbox on the...
    3. how to refresh page after date selection from popup calendar?
      If you are using window.open to popup the calendar, then before closing the popup you can use 'opener ' handler which gives you the parent page to...
    4. asp.net calendar popup control -- Loosing hair
      Check out this article, http://www.microsoft.com/india/msdn/articles/PopupCalendarinASP.aspx -- Saravana Microsoft India Community Star,...
    5. popup calendar helper
      Can anyone direct me to any resource or explain how to use the following calendar helper within Dreamweaver 4.0? This was written for MX, which I...
  3. #2

    Default Re: Using Calendar as a popup

    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, [url]www.aboutfortunate.com[/url], 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:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche


    "Merex" <merex@cox.net> wrote in message
    news:f734ed08.0308070535.1a99205d@posting.google.c 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

    S. Justin Gengo Guest

  4. #3

    Default Using Calendar as a popup

    Hi

    Check out this may help you.

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

    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
    >.
    >
    Ravikanth[MVP] Guest

  5. #4

    Default Using Calendar as a popup

    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
    >.
    >
    jayuya Guest

  6. #5

    Default Re: Using Calendar as a popup

    Check out this article ( this was the article mentioned by jayuya)
    [url]http://www.microsoft.com/india/msdn/articles/PopupCalendarinASP.aspx[/url]
    or
    [url]www.extremeexperts.com/net/articles[/url] (For more articles on .NET)

    --
    Saravana
    Microsoft India Community Star,MC**
    [url]www.extremeexperts.com[/url]



    "jayuya" <jayuya@cox.net> wrote in message
    news:0c9901c35d08$be2fefc0$a601280a@phx.gbl...
    > 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
    > >.
    > >

    Saravana Guest

  7. #6

    Default Re: Using Calendar as a popup

    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
    Merex Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139