Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从包装在UpdatePanel中的web部件控件执行javascript函数?_C#_Asp.net_Sharepoint_Updatepanel_Web Parts - Fatal编程技术网

C# 如何从包装在UpdatePanel中的web部件控件执行javascript函数?

C# 如何从包装在UpdatePanel中的web部件控件执行javascript函数?,c#,asp.net,sharepoint,updatepanel,web-parts,C#,Asp.net,Sharepoint,Updatepanel,Web Parts,我正在使用一个SharePoint web部件,它有一个日历控件,现在在calendar\u VisibleMonChanged事件中,我试图调用一个javascript函数,如: protected void cldEvents_VisibleMonthChanged(object sender, MonthChangedEventArgs e) { var jQueryFn = "bindScrollBar();"; ScriptManager.RegisterStartup

我正在使用一个SharePoint web部件,它有一个日历控件,现在在calendar
\u VisibleMonChanged
事件中,我试图调用一个javascript函数,如:

protected void cldEvents_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
{
    var jQueryFn = "bindScrollBar();";
    ScriptManager.RegisterStartupScript(this, this.GetType(), "Test", jQueryFn, true);
}
但这并没有发生。 (注意:控件包装在更新面板中)

请帮助实现这一目标


提前谢谢。

我认为您的
RegisterStartupScript
调用应该是这样的:

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

这里您传递的是页面引用,而不是UpdatePanel。

只需尝试将简单警报放入jQueryFn字符串中即可。像
jQueryFn=“alert('test');”
@Ali.NET我试过了,运气不好。