search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to call javaScript method from CallBack DayPilotCalendar1_EventClick

Asked by shimon
10 years ago.

protected void DayPilotCalendar1_EventClick(object sender, EventClickEventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "editModal();", true);
}

in this call this function should open a modal window from javascript function.
but this doesnt happen.

thank you

Comment posted by shimon
10 years ago.

ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "editModal();", true);
this command works from another methods in the C# class.

Answer posted by Dan Letecky [DayPilot]
10 years ago.

It depends on what you actually want to do (and it looks like #1 is what you are looking for):

1. If you only want to call a client-side method, use EventClickHandling="JavaScript" and specify your javascript code using EventClickJavaScript, e.g. EventClickJavaScript="editModal(e)". See also:

http://doc.daypilot.org/calendar/event-click/

2. If you want to execute a server-side method first, you need to use EventClickHandling="CallBack" and send custom data using Update() and handle it using AfterRender event handler:

http://doc.daypilot.org/calendar/callback-update/
http://doc.daypilot.org/calendar/afterrender/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.