使用AjaxControlToolkit的HoverMenuExtender时出现问题 [英] Problems using AjaxControlToolkit's HoverMenuExtender

查看:82
本文介绍了使用AjaxControlToolkit的HoverMenuExtender时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用AjaxControlToolkit中的HoverMenuExtender的Page。它出乎意料地开始给我以下两个错误:


行:1165

错误:'this._form.onsubmit'为null或不是对象


AND:


行:250

错误:'null'为空或不是对象


我不仅收到了这些错误,而且当页面打开时,HoverMenuExtender使用的菜单也都可见(并且它们不会消失)。错误中的代码都来自AjaxControlToolkit生成的代码。直到最近
才开始收到这些错误,而且我没有更改任何与触发器,扩展器或菜单相关的代码。我的页面包括以下两者(以及触发器和菜单本身):


< ajax:ToolkitScriptManager runat =" server" />

< ajax:HoverMenuExtender ID =" hmeServices" RUNAT = QUOT;服务器"的TargetControlID = QUOT; imgServices" PopupControlID = QUOT; divServicesMenu" PopupPosition =" Bottom" />


我找不到任何可能导致此问题的代码,因为所有JavaScript都是由AJAX生成的,并且因为它之前有效,我无法想象我能做些什么才能让这个开始发生。我做了多次搜索,但没有成功。
是否对任何人有什么想法或建议?任何帮助,将不胜感激。谢谢。




Nathan Sokalski

njsokalski@hotmail.com

http://www.nathansokalski.com/



Nathan Sokalski njsokalski@hotmail.com http:// www .nathansokalski.com /

解决方案

在网上花了几个小时的研究后,我终于找到了我所假设的导致问题的方法。我之前在母版页中使用的脚本标记是:


< script type =" text / javascript" src =" /Scripts/HoverMenu.js" />


请注意,此标记是自动关闭的。我将其更改为:


< script type =" text / javascript" src =" /Scripts/HoverMenu.js">< / script>


一切正常。我似乎记得过去的情况< title />不允许,但< title>< / title>是(标题显然没有给我脚本错误,但xhtml验证器会抱怨)。这是与脚本相同的
类型的情况,其中开放和关闭必须是分开的?我以前从未遇到过使用自动关闭脚本标签的问题,即使我的许多页面都有来自AjaxControlToolkit的控件(我不认为
之前我曾经使用过HoverMenuExtender,所以我猜猜它可能是特定的)。但无论如何,它现在解决了我的问题,我只想知道xhtml是否真的需要单独的打开和关闭脚本标签。感谢。


I have a Page that uses the HoverMenuExtender from the AjaxControlToolkit. It unexpectedly started giving me the following two errors:

Line: 1165
Error: 'this._form.onsubmit' is null or not an object

AND:

Line: 250
Error: 'null' is null or not an object

Not only am I recieving these errors, but the menus used with the HoverMenuExtender are also all visible when the Page opens (and they don't disappear). The code in the errors are both from the code generated by the AjaxControlToolkit. It was not until recently that I started recieving these errors, and I have not changed any of the code related to the triggers, extenders, or menus. My Page includes both of the following (along with the triggers and menus themselves):

<ajax:ToolkitScriptManager runat="server"/>
<ajax:HoverMenuExtender ID="hmeServices" runat="server" TargetControlID="imgServices" PopupControlID="divServicesMenu" PopupPosition="Bottom"/>

I can't find any code that could be causing this, since all the JavaScript is generated by the AJAX, and since it was working before, I can't imagine what I could have done to make this start happening. I have done multiple searches, but no success. Does anybody have any ideas or suggestions as to where else to look? Any help would be appreciated. Thanks.


Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/


Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

解决方案

After spending hours of researching on the web, I finally found what I'm assuming was causing the problem. A script tag that I had in the Master Page was previously:

<script type="text/javascript" src="/Scripts/HoverMenu.js"/>

Take note that this tag is self-closing. After I changed it to:

<script type="text/javascript" src="/Scripts/HoverMenu.js"></script>

Everything worked correctly. I seem to remember a situation in the past in which <title/> was not allowed, but <title></title> was (title obviously didn't give me script errors, but the xhtml validator would complain). Is this the same type of situation with script, in which the opening and closing must be separate? I have never had a problem with using self-closing script tags in the past, even though many of my pages have had controls from the AjaxControlToolkit in them (I don't think I ever used the HoverMenuExtender before, so I guess it could be specific to that). But anyway, it fixed my problem for now, I would just like to know if xhtml really does require separate opening and closing script tags. Thanks.


这篇关于使用AjaxControlToolkit的HoverMenuExtender时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆