id is null or not an object?

Jul 8, 2011 at 11:11 PM

I get the following error when run in IE: Microsoft JScript runtime error: 'id' is null or not an object. 

Looking into this it occurring in the following part of the javascript:

foolproof.getId=function(a,b) {var"_")+1; 

Unraveling the data, I see that a is undefined when calling the function. b is the name I define in the condition ("SetsMax")

        [LessThanOrEqualTo("SetsMax", ErrorMessage = "Maximum sets must be greater than or equal to starting sets")]
[Required(ErrorMessage = "You must specify a number of sets (use zero for none)")] [Range(0, int.MaxValue, ErrorMessage = "Sets must be positive")] public int Sets { get; set; } [Required(ErrorMessage = "You must specify a maximum number of sets (use zero for none)")] [Range(0, int.MaxValue, ErrorMessage = "Maximum sets must be positive")] [DisplayName("Max Sets")] public int SetsMax { get; set; }

In my testing both values in the model had values, though making the condition true or false seems to make no difference as the error occurs always.

I had this issue before, and never found a solution ( this is particularly curious as I have updated to the latest MVC Foolproof and completely rewrote the majority of my code/data/conditions.




Jul 11, 2011 at 3:20 PM

What version of MVC are you using? If 3, do you have unobtrusive validation turned on or off?

Jul 13, 2011 at 5:17 PM

I am using version 2.