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.