IIS 7.5: Microsoft JScript runtime error: Object expected

Jan 31, 2011 at 6:44 PM

Hi folks,

I'm testing this project within an IIS 7.5, 64bits, VS2010  and I'm getting this JS runtime exception at $(document).ready(setupMenuEvents);

It's strange because the menu runs fine if you use the VS developer server.

I'm testing the demo site. Any suggestion?

Cheers

Apr 12, 2011 at 8:51 PM

Hi,

I just had the same problem and spent ages finding the solution.

In my case I was using the menu in a master page.  It turns out that the JQuery reference wasn't resolving correctly.  I changed the JQuery path to an absolute reference and it worked.  Then I added this code to the Page_Init method in the code behind:

 

JQueryLiteral.Text = "<script type=\"text/javascript\" src=\"" + ResolveUrl("~/Scripts/jquery-1.4.4.min.js") + "\" ></script>";

and created a literal called JQueryLiteral within the HEAD tags in the markup to replace the static reference.