我有一个更新面板加载了一个用户控件,此处的目标是在发生这种情况时调用特定的JavaScript函数。 我认为可以通过Script Manager来完成,但如果有html替代方案,则不需要这样做。
流程基本如下:
用户单击按钮 更新面板加载控件 调用JavaScript函数
非常感谢。我已经尝试过RegisterStartupScript(..),但可能存在语法错误。
解决方案:
流程基本如下:
用户单击按钮 更新面板加载控件 调用JavaScript函数
非常感谢。我已经尝试过RegisterStartupScript(..),但可能存在语法错误。
if (show)
{
string scriptId = String.Format("{0}:script", ++uniquePopupId);
string scriptTag = String.Format("showPopup({0},{1});", Width, Height);
ScriptManager.RegisterStartupScript(this, this.GetType(), scriptId, scriptTag, true);
}
解决方案:
if (show)
{
string scriptId = String.Format("{0}:script", ++uniquePopupId);
string scriptTag = String.Format("showPopup({0},{1});", Width, Height);
ScriptManager.RegisterStartupScript(updPanelChildControl, updPanelChildControl.GetType(), scriptId, scriptTag, true);
}