Popup from Calendar control

Discussion in 'ASP .Net' started by Peter, Aug 1, 2005.

  1. Peter

    Peter Guest

    Does anyone have an example of how you would do a popup window when a user clicks on a day number link in the ASP.NET Web Calendar control?

    I am trying to create an event calendar similar to how Outlook works. When user clicks on the day number in the calendar control I want to display a popup window and let user add data and click on the Save button. The code under the save button will save the data to the database and close the popup window.


    Thanks


    Peter
    Peter, Aug 1, 2005
    #1
    1. Advertising

  2. Look at http://www.codeproject.com/aspnet/MellDataCalendar.asp





    "Peter" wrote:

    > Does anyone have an example of how you would do a popup window when a user clicks on a day number link in the ASP.NET Web Calendar control?
    >
    > I am trying to create an event calendar similar to how Outlook works. When user clicks on the day number in the calendar control I want to display a popup window and let user add data and click on the Save button. The code under the save button will save the data to the database and close the popup window.
    >
    >
    > Thanks
    >
    >
    > Peter
    >
    >
    =?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=, Aug 1, 2005
    #2
    1. Advertising

  3. Peter

    Peter Guest

    Thanks for your help!

    Unfortunatly the example does not have any popup windows and that's my main
    problem.

    How do I display a modal popup window when I user clicks on the day number
    link?


    "Jouni Karppinen" <> wrote in
    message news:...
    > Look at http://www.codeproject.com/aspnet/MellDataCalendar.asp
    >
    >
    >
    >
    >
    > "Peter" wrote:
    >
    >> Does anyone have an example of how you would do a popup window when a
    >> user clicks on a day number link in the ASP.NET Web Calendar control?
    >>
    >> I am trying to create an event calendar similar to how Outlook works.
    >> When user clicks on the day number in the calendar control I want to
    >> display a popup window and let user add data and click on the Save
    >> button. The code under the save button will save the data to the
    >> database and close the popup window.
    >>
    >>
    >> Thanks
    >>
    >>
    >> Peter
    >>
    >>
    Peter, Aug 1, 2005
    #3
  4. On example OnDayRender-method is overridden. In my event calendar day number
    isn't clickable at all, instead all event names are shown as hyperlinks for
    each day.

    Here few ideas:

    protected override void OnDayRender(TableCell cell, CalendarDay day)
    {
    //Alternative 1:
    cell.Text = "<a href=\"#\" onclick=\"javascript:alert('foo')\">Click me</a>";

    //or alternative 2 - not tested:
    HyperLink newLnk = new HyperLink();
    newLnk.NavigateUrl = "#";
    newLnk.Attributes.Add("onclick", "javascript:alert('foo')");
    newLnk.Text = "Click me";
    cell.Controls.Add(newLnk);

    base.OnDayRender (cell, day);
    }

    I haven't tested alternative no. 2, I don't know if you can set hyperlink
    only to fire javascript-event without setting NavigateUrl property.

    Hope this helps.

    "Peter" wrote:

    > Thanks for your help!
    >
    > Unfortunatly the example does not have any popup windows and that's my main
    > problem.
    >
    > How do I display a modal popup window when I user clicks on the day number
    > link?
    >
    >
    > "Jouni Karppinen" <> wrote in
    > message news:...
    > > Look at http://www.codeproject.com/aspnet/MellDataCalendar.asp
    > >
    > >
    > >
    > >
    > >
    > > "Peter" wrote:
    > >
    > >> Does anyone have an example of how you would do a popup window when a
    > >> user clicks on a day number link in the ASP.NET Web Calendar control?
    > >>
    > >> I am trying to create an event calendar similar to how Outlook works.
    > >> When user clicks on the day number in the calendar control I want to
    > >> display a popup window and let user add data and click on the Save
    > >> button. The code under the save button will save the data to the
    > >> database and close the popup window.
    > >>
    > >>
    > >> Thanks
    > >>
    > >>
    > >> Peter
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=, Aug 2, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saravana
    Replies:
    0
    Views:
    487
    Saravana
    Jul 11, 2003
  2. Stephajn Craig

    Javascript PopUp using Calendar Control

    Stephajn Craig, Jul 22, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    630
    Saravana
    Jul 23, 2003
  3. Shevek
    Replies:
    3
    Views:
    6,012
    Shevek
    Jun 23, 2004
  4. Shevek
    Replies:
    0
    Views:
    375
    Shevek
    Jun 23, 2004
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    502
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page