简体   繁体   English

Visual Studio 2013 Javascript无法识别“ <%=%>”吗?

[英]Visual Studio 2013 Javascript doesn't recognize '<%= %>'?

When I am upgrading from Visual Studio 2010 to Visual Studio 2013. The code in Javascript in VS 2010 shown red text in between ' ' and the website is working fine, 当我从Visual Studio 2010升级到Visual Studio 2013时。VS2010中Javascript中的代码在“”和网站之间显示红色文本,工作正常,

id = '<%= Company.NEAt.GetUserID().ToString() %>';

But in VS 2013, it doesn't show red text in between ' ' and I got error on website saying, 但是在VS 2013中,“”之间没有显示红色文本,并且我在网站上看到错误消息,

System.NullReferenceException: Object reference not set to an instance of an object.

Anyone know why? 有人知道为什么吗?

I found a solution that I wasn't expecting. 我找到了意想不到的解决方案。

All I had to do is disable anonymous Authentication in IIS and it worked fine. 我要做的就是在IIS中禁用匿名身份验证,它工作正常。 It because this code is waiting to get window authentication, not anonymous. 这是因为此代码正在等待获取窗口身份验证,而不是匿名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM