0

我有以下代码片段

<asp:UpdatePanel runat="server" ID="UpdatePanelFred">
      <ContentTemplate>
            <div id="divMandatory" style="cursor: pointer; vertical-align: bottom; color:     #dc143c; font-size: 16px;"
                runat="server" onmouseover="jQuery('#MandatoryModalPopup').show();" onmousedown="jQuery('#MandatoryModalPopup').hide();">
                    <span id="starspan"  style="cursor: pointer; vertical-align: bottom; horiz-align: center;  color: #dc143c; font-size: 16px;" runat="server" onmouseover="$('#UpdatePanelFred').Update();">*</span>
            </div>
      </ContentTemplate>
</asp:UpdatePanel>   

当我将鼠标悬停在跨度上时,出现此错误

未捕获的类型错误:对象 # 没有方法“更新”

据我了解,这意味着我没有选择 UpdatePanelFred UpdatePanel。

我对 jQuery 的了解非常有限,而且我确信我缺少一些超级基础的东西。

周五......

4

1 回答 1

1

如果您尝试从客户端代码刷新更新面板,请尝试将跨度鼠标悬停更改为:

onmouseover="__doPostBack('UpdatePanelFred', '');"

但也许你应该重新考虑你的方法。想象一下用户不断在它上面挥动鼠标——这将导致多次回发。

于 2013-10-18T14:20:21.397 回答