Popup from Calendar control

P

Peter

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
 
P

Peter

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?
 
G

Guest

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Taskcproblem calendar 4
Popup HTML help 5
Positioning a popup 1
Positioning a popup 10
Help with popup display 1
Calendar popup - sort of 2
Non-popup calendar control? 5
Calendar control issue 4

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top