简体   繁体   English

在asp.net文本框上获取JavaScript错误textmode = password

[英]Getting javascript error on asp.net textbox textmode=password

This is a very strange error, to me at least. 至少对我来说,这是一个非常奇怪的错误。

Using Visual Studio 2012. Using Internet Explorer version 11. Have an application that uses an asp:Textbox with textmode="password" When running from within Visual Studio, whenever I type or delete it comes up with an error in the script block 使用Visual Studio2012。使用Internet Explorer11。拥有一个使用asp:Textbox和textmode =“ password”的应用程序在Visual Studio中运行时,每当我键入或删除它时,脚本块中都会出现错误。

0x800a138f - JavaScript runtime error: Unable to get property 'getAttribute' of undefined or null reference 0x800a138f-JavaScript运行时错误:无法获取未定义或空引用的属性“ getAttribute”

So after spending loads of time going through the code I decided to create a test site from scratch and start adding things to make it like my project so I can identify where the problem may be. 因此,在花了很多时间遍历代码之后,我决定从头开始创建一个测试站点,并开始添加使其与我的项目类似的东西,以便我可以确定问题所在。

I created a project with the Asp.net Webforms template. 我使用Asp.net Webforms模板创建了一个项目。 Then I went directly (before I would try to make any changes) to the login page of the template site and tried to start typing in the password field, it immediately came up with the same error. 然后,我直接(在尝试进行任何更改之前)转到模板站点的登录页面,并尝试开始在密码字段中输入内容,它立即出现相同的错误。 Its fine in Chrome! 在Chrome中效果不错!

Its as though the thing that intercepts the characters in the textbox and turns them into dots is crashing in Internet Explorer... 好像拦截文本框中的字符并将其变成点的事情在Internet Explorer中崩溃了...

No errors in the Chrome console. Chrome控制台中没有错误。

What on Earth is it? 这到底是什么?

Right! 对!

Found the answer, its something to do with the Visual Studio debugging settings. 找到了答案,这与Visual Studio调试设置有关。 The particular project that I'm working on uses Silverlight. 我正在处理的特定项目使用Silverlight。 So just going into the properties settings then ticking the Silverlight debugger settings under the web tab changed the debug settings, now it doesn't stop and start debugging with every entered key in a password text box. 因此,只需进入属性设置,然后在Web选项卡下的Silverlight调试器设置上打勾,即可更改调试设置,现在它不会停止并使用密码文本框中的每个输入键开始调试。

So just to be clear, I don't know what option was ticked before, but adding the tick to the Silverlight option meant that what ever was there before is now changed, so the problem is solved. 因此,为了清楚起见,我不知道之前勾选了哪个选项,但是将勾号添加到Silverlight选项意味着现在更改了以前的内容,因此问题得以解决。

There is no code to present because I started it from a template. 没有代码可显示,因为我是从模板启动的。 The debugger that I'm referring to is the debugger inside Visual Studio, as I was starting the application from Visual Studio. 我指的调试器是Visual Studio中的调试器,因为我是从Visual Studio启动应用程序的。

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

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