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" <Jo************@discussions.microsoft.com> wrote in
message news:3D**********************************@microsof t.com... 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