使用Internet Explorer时的Visual Studio抛出异常 [英] Visual Studio throwing exceptions when using Internet Explorer

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

问题描述

编码ASP.net Web应用程序与Visual Studio,我从未有过任何问题,当Chrome或Firefox为默认浏览器。但是,当它的IE浏览器,一个所谓的新项目脚本文件 suddently出现在我的项目资源管理器和Visual Studio始终显示在每一个页面的新项目,该项目的异常负荷:

Coding ASP.net web app with visual studio, i never had any problem when chrome or firefox is the default explorer. But when it's IE, a new project called Script documents suddently appear in my project explorer and visual studio always shows that exception in the new project for every pages load :

JavaScript执行错误:无法获取的空或未定义引用属性变量名

这并不prevent Web应用程序的工作,它只是恼人不得不每次切换页面,而debuging时间在Visual Studio中的窗口中单击。

Which doesn't prevent the web app to work, it's just annoying to have to click on the window in visual studio every time i switch pages while debuging.

该窗口提供我停下来,继续或忽略。

The window offers me to Stop, Continue, or Ignore.

忽略使窗口重新出现瞬间,继续让它disapear一小会儿......

Ignore make the window reappear instantly, continue make it disapear for a little while...

还没有找到任何解决它在谷歌,无论是在这里。

Haven't found anything that solve it on google, neither in here.

这又如何解决呢?又是怎样的探险家如此不同?

How can this be solved ? And how is explorer so different ?

编辑:

以此为个例,我是pretty确定它应该工作:

Taking this as an exemple, i'm pretty sure it SHOULD work :

jQuery是没有定义Twitter的引导

和尽管如此,窗口总是弹出在我的IE 11,说它没有foud的标签名属性。

And still, the window always pop-up in my IE 11, saying that it haven't foud the tagName property.

所以,现在我的新问题是,我有,因为我使用boothstrap指定每个对象的标签名?抑或是别的东西造成的问题?

So now my new question is, do i have to specify the tag name of every object because i use boothstrap ? Or is it something else that cause the problem ?

编辑:

这是母版页的codeS:

This is the Master Page's codes :

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Canevas.master.cs" Inherits="MandatMobile.Canevas" %>
<%@ Register Src="~/Controls/Menu.ascx" TagPrefix="ctrl" TagName="Menu" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">    </script>
  <script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<title></title>
    <asp:ContentPlaceHolder ID="HeadContent" runat="server" >
    </asp:ContentPlaceHolder>
</head>
<body>

    <form runat="server" style="position:absolute; left:10px;">
    <asp:Image runat="server" ImageUrl="~/Img/Fullogo.jpg" ></asp:Image>


    <h2 style="position:absolute; top:-5px; left:120px; width:1200px;" >
    <asp:ContentPlaceHolder ID="title" runat="server" >
    </asp:ContentPlaceHolder>
    </h2> 

   <%if (Convert.ToInt32(Session["Level"]) != 1)
    { %>

    <div style="position:absolute; top:110px; left:0px;">
    <ctrl:Menu ID="Menu1" runat="server" ></ctrl:Menu>
</div>

<% } %>

<br /><br /><br /><br />
    <asp:ContentPlaceHolder ID="BodyContent" runat="server" >
    </asp:ContentPlaceHolder>

  </form>

  </body>
  </html>

解决:

这是ridiculus ......还有一个菜单之前,我建这一次,我所做的就是把在HTML注释和code我在同一页上的新菜单中的previous菜单,但在菜单评论是仍有上涨,即使它在评论它仍在寻找它的引用,就像它在评论WASEN'T ...必须...我想这将是我的新问题

It was ridiculus... there was another menu before i build this one, what i did was put the previous menu in HTML comment and code my new menu on the same page, but the menu in comment was still up and even though it was in comment it was still looking for it's references, just like it WASEN'T in comment... What the... i think that is going to be my new question

推荐答案

好了很多问题,让回答一个接一个:

Ok A lot of questions lets answer one by one:

但是,当它的IE浏览器,一个叫脚本文件suddently出现在我的项目资源管理器中的新项目......

"But when it's IE, a new project called Script documents suddently appear in my project explorer ..."

,你叫这个项目,是视觉工作室的机制,允许开发商在IDE(Visual Studio中)调试JavaScript,但这仅适用于IE浏览器的工作,因为,只要我知道,有没有没有有趣从微软(或浏览器的创造者),使其成为其他浏览器。

This project as you called, is a mechanism of visual studio that allows the developers debug javascript in the IDE (Visual Studio), but this only work for IE, because, as long as I know, there wasn't no interesting from Microsoft (or the browsers creators) to make it work for other browsers.

如果你想更好地理解它是什么以及如何使用,启用,禁用看到这个帖子:的在IE 使用Visual Studio调试JavaScript的。

If you want to understand better what is it and how to use, enable, disable see this post: Using Visual Studio to Debug JavaScript in IE.

......和Visual Studio始终显示在每个页面上的新项目,例外载:

"...and visual studio always shows that exception in the new project for every pages load :"

由于 @Mithun Pattankar 在你的问题评论说,可能是在其他浏览器中出现此异常也一样,但是当你使用Chrome或Firefox,你会更安静得到这个例外。看你有没有去DevTools(F12铬)或其他自定义工具,才将看到它。

As @Mithun Pattankar commented in your question, probably this exception occurs in other browsers too, but when you use chrome or firefox, you will get this exception more quietly. To see you have to go to DevTools (F12 in chrome) or some other custom tool, only then will see it.

但是,因为你有在JavaScript的启用VS,当你使用IE浏览器,异常是在VS抛出,而不是浏览器。调试

But because you have the debug javascript in VS enabled, when you used the IE, the exception was thrown in VS instead of the browser.

和尽管如此,窗口总是弹出在我的IE 11,说它没有foud标记名属性。

And still, the window always pop-up in my IE 11, saying that it haven't foud the tagName property.

所以,现在我的新问题是,我有,因为我使用boothstrap指定每个对象的标签名?

So now my new question is, do i have to specify the tag name of every object because i use boothstrap ?

好一些误导这里。首先的问题是不是与标签名属性。让我来解释一下:

Ok some misguidance here. First the problem isn't with the tagName property. Let me explain:

这是你得到的信息错误是无法获取属性的空或未定义参考变量名。见code波纹管:

The message error that you got was "Unable to get the property "tagName" of a null or undefined reference". See the code bellow:

var v1 = { aGenericPropertyName: 10 };

v1.aGenericPropertyName = 20;

var v2 = v1.aGenericPropertyName;

v1 = null;
//or:
v1 = undefined;

var v3 = v1.aGenericPropertyName;

在最后一行,取决于浏览器,你可能会得到这个异​​常:

In the last line, depending on the browser, you may get this exception:

无法获取属性aGenericPropertyName的空或未定义的引用。

你得到它呢?问题不在于财产,是调用属性或更高的精度没有一个对象(null或undefined)的一个变量(在我的例子code中的变量V1)的对象。

Did you get it now? The problem isn't the property, is the object that call the property or more accuracy the absence of an object (null or undefined) in a variable (in my sample code the variable v1).

抑或是导致问题的东西?

Or is it something else that cause the problem ?

那么这里是真正的问题,因为这种错误可以在您添加到页面的任何JavaScript code的任何部分基本上发生。因此,它不可能仅由表面寻找解决这个问题。

Well here's the real problem, because this kind of error can occur basically in any part of any javascript code that you added to the page. So it's not possible to solve this only by looking superficially.

我有,如果你想尝试一些建议。首先,确保你有bootstrap.js和jquery.js和正确的文件,而且它们自身之间兼容。第二次检查,如果这个错误发生在您的自定义JavaScript文件中的一个。

I have some suggestions if you want to try. First, make sure you have the correct files of bootstrap.js and jquery.js and they are compatible between itself. Second check if this error is occurring in one of your custom javascript files.

除此之外,我们只能帮你,如果你发布异常的确切的行和文件如何发生错误。

Beyond that we will only be able to help you, if you post the exact line of the exception and how file the error occurs.

这篇关于使用Internet Explorer时的Visual Studio抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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