Causes And Fixes For "Error: Sys.ArgumentNullException: Value cannot be null." In JQuery



TODO:

You make some changes the ASP.net controls on your form, and possible your JQuery.  You run your application and you end up with "Error: Sys.ArgumentNullException: Value cannot be null."  

 

SOLUTION:

95% of the time I have had this issue, the problem was that I removed a control, and its references in the .cs file, but forgot it in the JQuery.  So in the JQuery I was doing a .hide() on the removed control which causes the cryptic error above.  To debug I simply looked for each instance of $('#mycontrolxxxxxxx').hide(); and made sure that #mycontrolxxxxxxx actually still existed.  Sure enough, I forgot to remove a JQuery line.  Once I removed the rogue JQuery line, the issue went away. 

 

NOTES:

There are no notes on this topic.



Comments (1) -

Syed
Syed
2/6/2014 10:28:55 AM #

I am also getting this error in IE10 and IE11  for the pages having AjaxToolkit. Don't know where is fix is..

Javascript Error in browser's console:

"SCRIPT5022: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
Parameter name: element"

Help me how to fix??

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading