为什么在运行ASP.NET站点时在IE中出现异常,但在Chrome中却没有? [英] Why do I get an exception in IE but not Chrome when running my ASP.NET site?

查看:138
本文介绍了为什么在运行ASP.NET站点时在IE中出现异常,但在Chrome中却没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我终于能够在我的常规/首选浏览器-Chrome中运行旧版网站.我试图查看如何在F12工具中逐步浏览javascript代码.当我看不到如何访问脚本代码时,我做了一些研究,发现ASP.NET项目的javascript调试只能(可能是?)只能在IE中完成.

I was finally able to get a legacy site to run, in my regular/preferred browser - Chrome. I was trying to see how to step through the javascript code there in the F12 tools. When I couldn't see how to access the script code, I did some research, and found that javascript debugging of ASP.NET projects can (supposedly?) only be done in IE.

因此,在项目中,我将浏览器从Chrome切换为IE.现在,当我尝试从VS IDE打开该站点时,它因异常而中断:

So in the project, I switched the browser to use from Chrome to IE. Now when I try to open the site from the VS IDE, it breaks with an exception:

为什么Chrome会轻松地忽略此问题,或者为什么IE会引起问题呢?

Why would Chrome merrily ignore this, or why does IE grouchily make an issue of it?

在Chrome中,我看到了各种ScriptResource文件:

In Chrome, I see various ScriptResource files:

...但是这些似乎已成为网站自定义javascript的全部内容-Microsoft和Telerik代码.

...but these seems to be everything BUT the custom javascript for the site - Microsoft and Telerik code.

此ASP.NET网站以.NET 3.5为目标; IE 11; Visual Studio 2013.

This ASP.NET site targets .NET 3.5; IE 11; Visual Studio 2013.

推荐答案

您正在从Cookies集合中请求商品.此Cookie很可能存在Chrome,而不会给出例外.可能在获取异常的Internet Explorer中不存在该Cookie.

you are requesting an item from the Cookies collection. It is very likely that this cookie exists Chrome, where it does not give the exception. And probably this cookie does not exist in Internet Explorer, where you get the exception.

在进一步处理之前,始终检查Request.Cookies [...]是否为空.

Always check if the result if Request.Cookies[...] is null before further processing.

这篇关于为什么在运行ASP.NET站点时在IE中出现异常,但在Chrome中却没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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