积极答复者
Microsoft JScript 运行时错误: '__EVENTTARGET' 为空或不是对象

问题
-
我是windows 2003 X64+vs2008 代码如下:
无标题页 ============================================== using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Timer1_Tick(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); } } } 为何总是Microsoft JScript 运行时错误: '__EVENTTARGET' 为空或不是对象,然后就要中断?- 已编辑 yzjiujian 2009年10月28日 23:40 示例
答案
-
问题找到了!!!
在32位的浏览器里面有一个iesuper.com的加载项,禁用后就恢复正常了,感觉真好啊,真不知道这个东西是怎么到我系统里面的!
如果有和我类似问题的朋友,可以检查ie加载项- 已标记为答案 KeFang Chen 2009年10月30日 3:15
全部回复
-
应该是你使用问题,测试没有问题<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Timer1_Tick(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="2000"> </asp:Timer> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </form> </body> </html>
【孟子E章】 -
代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>无标题页</title> <script type="text/javascript"> function pageLoad() { } </script> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> <asp:Timer ID="Timer1" runat="server" Interval="3000" ontick="Timer1_Tick"> </asp:Timer> </form> </body> </html>
后台:using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Timer1_Tick(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); } } }
运行后几秒就出现:Microsoft JScript 运行时错误: 'theForm.__EVENTTARGET' 为空或不是对象
请问我哪里有问题? -
测试你的代码没有出现问题测试环境:ie8,ff3.5,chrome3另外,为了避免刷新,还可以这样
<asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick"> </asp:Timer> </ContentTemplate> </asp:UpdatePanel>
【孟子E章】 -
我的环境 2003(64)+vs2008+IE 8.0
我用TT浏览器试是好的,64位IE输入网址试也是好的。但是vs2008里面的IE就是不行,不知道什么原因
改注册表:
Please follow the following steps:
- Open regedit (on a 64-bit OS, open the 32-bit regedit)
- Under “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Zones”, create a new key called 1000 (if it isn't already there)- Under 1000, create a DWORD entry with:
o Name = 1207
o Type = REG_DWORD
o Data = 0x000000
可我用他们的方法,不行,将升说要下一个叫IE8AddZone.rar的东西就可以解决,但是我下载了还是不行,依然是运行后几秒就出现:Microsoft JScript 运行时错误: 'theForm.__EVENTTARGET' 为空或不是对象。甚至下载32位和64位的java虚拟机也不行。郁闷啊。 -
-
mldark ,我帖子里面已经说用他们的方法还是不行了
我的环境 2003(64)+vs2008+IE 8.0
我用TT浏览器试是好的,64位IE输入网址试也是好的。但是vs2008里面的IE就是不行,不知道什么原因
改注册表:
“HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones”, create a new key called 1000 - Under 1000, create a DWORD entry with:
o Name = 1207
o Type = REG_DWORD
o Data = 0x000000
可我用他们的方法,不行,
说要下一个叫IE8AddZone.rar的东西就可以解决,但是我下载了还是不行,
依然是运行后几秒就出现:Microsoft JScript 运行时错误: 'theForm.__EVENTTARGET' 为空或不是对象。甚至下载32位和64位的java虚拟机也不行。郁闷啊。 -
问题找到了!!!
在32位的浏览器里面有一个iesuper.com的加载项,禁用后就恢复正常了,感觉真好啊,真不知道这个东西是怎么到我系统里面的!
如果有和我类似问题的朋友,可以检查ie加载项- 已标记为答案 KeFang Chen 2009年10月30日 3:15