Question

I am working a SharePoint web part, which have a calendar control, now on calendar _VisibleMonthChanged event I am trying to call a javascript function like :

protected void cldEvents_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
{
    var jQueryFn = "bindScrollBar();";
    ScriptManager.RegisterStartupScript(this, this.GetType(), "Test", jQueryFn, true);
}

But its not happening. (Note : the control is wrapped inside an Update Panel).

Please help achieving this.

Thanks in advance.

Was it helpful?

Solution

I think your RegisterStartupScript call should be like this:

ScriptManager.RegisterStartupScript(updatePanel, updatePanel.GetType(), "Test", jQueryFn, true);

Here you are passing page reference instead of UpdatePanel's.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top