Last post Mar 13, 2020 05:46 PM by bruce (sqlwork.com)
Feb 14, 2020 08:38 AM|dongtrien|LINK
In VS2010 design mode when I press F5 to run the program, I get the following error:
1. JavaScrip runtime error: Unable to set property 'showmessagebox' of undefined or null reference.
2. JavaScrip runtime error: Unable to set property 'evaluationfunction' of undefined or null reference.
When this error I have to press Continue will continue to run, how to fix it ? You see my attached photo file.
Feb 17, 2020 01:08 PM|Sean Fang|LINK
Generally, your problems are caused due to accessing to an undefined or null reference as the error mentioned.
For the first error, you are tring to access an element through document.all which is already Deprecated since HTML5.
As you can refer to :https://developer.mozilla.org/en-US/docs/Web/API/Document/all
Instead, document.getElementById are recommended for most cases.
Code will be working as below :
var ct100_....._valChangePasswordSummary = document.getElementById ? document.getElementById("ct100_....._valChangePasswordSummary") : ......;
For the second error, could you please provide details/markup about the aspx page? That way, we are able to check what happened for the validators.
A possible solution:
Below article illustrates a bug in aspx client side when the validator controls are enclosed by html comments (<!-- -->).
Hope this can help you.
Feb 18, 2020 01:45 AM|dongtrien|LINK
The above error occurs with IE, I use other browsers without such as: coc coc, firefox, chorom.
When running with IE, strange files appear while running with other browsers not like Chorom, ... can you know the cause of this error ?
Feb 18, 2020 09:45 AM|Sean Fang|LINK
Thank you for your further information.
However, the strange files you said is the Script Section. Actually, it is expanded by default as the debugger runs. Using a browser other than IE prevents the "Script section" node from working but you can manually turn it on. It is not related to
your problem here.
What would be useful is the markup word of the HTML/.aspx Page, which could help me to reproduce the error you had since it is closely associated with the validators.
Also, it would be better to know which version of .Net Framework you use.
I reproduce your error under the .Net Framework 4.0.
When I put one validator in html comments like
<!--<asp:CustomValidator ID="validator2" ControlToValidate="box1" runat="server" ErrorMessage="Required !!!"></asp:CustomValidator>-->
, the java debugger throws an error "Cannot read property 'evaluationfunction' of null".
If you have the similar stuff, try to remove the html comment or whole markup.
Feb 19, 2020 04:21 AM|dongtrien|LINK
I use net 4.0, thank you for reading my post and for answering my questions.
Feb 19, 2020 10:05 AM|Sean Fang|LINK
I was wondering if my answer works for you solving the problem?
If your problem is still there, as I suggested, could you share the mark up of your html/aspx page ?
That way, I will be able to find the reason of the problem clearly.
Feb 20, 2020 04:46 AM|dongtrien|LINK
Currently I do not know how to fix this error, now I switch to other browsers to use, you write "could you share the
mark up of your html/aspx page ?" I have not debugged html code and java code, I only know debug C# code, which html/aspx page do you need ? I will send to you, if I copy a whole program that I cannot copy, give an error message in IE version
11, please see my attached photo. https://imgur.com/undefined
Mar 13, 2020 08:14 AM|Sean Fang|LINK
Are you using Visual studio to develop the web/application?
In the Solution Explorer section, you will find files with the suffix .aspx (for webforms).
Mar 13, 2020 05:46 PM|bruce (sqlwork.com)|LINK
the error means the previous line did not find the element. either the script comes before the element is defined, or its not defined.