Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined

Md Nasir Uddin picture Md Nasir Uddin · May 9, 2011 · Viewed 9.5k times · Source

I am Developing a web application by using ASP.NET 3.5, jQuery and RadAjax Telerik Control. I get Error Messages when page Loading. that is :"Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined" . Image:enter image description here

and when I click to Open RadWindow then get same Error Message. and could not open radwindow.

Image 2:enter image description here

How can I solved this Error. Help me..

Thanks Nahid

Answer

justdan23 picture justdan23 · Feb 23, 2012

This issue is isolated to the jQuery Validate Javascript Library.

The script filename is: jquery.validate.unobtrusive.min.js

Although jQuery is Open Source, this library was provided by Microsoft (as indicated at the top of my js file):

/*
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/

Try replacing the library to use the replacement jquery.validate.min.js

One way is to use Visual Studio's NuGet Package Manager by the following:

  1. Right-click on your Project's References folder
  2. Select 'Add Library Package Reference...'
  3. When the window opens, Select 'Online' from the left sidebar menu.
  4. On the top-right, type in 'jquery.validate' and hit the enter key.
  5. Locate the 'jQuery Validation' and click the 'Install' button.
  6. Change your code to use the new library name 'jquery.validate.min.js'

I tested this and my client-side field validation all seems to work without the annoying exceptions when debugging in Visual Studio.