简体   繁体   中英

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,

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

But in VS 2013, it doesn't show red text in between ' ' and I got error on website saying,

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. It because this code is waiting to get window authentication, not anonymous.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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