locked
Object Expected Error Menu Control RRS feed

  • Question

  • User1075480869 posted

    I am currently experiencing a javascript "Object Expected" error when rolling over the main menu on the top of the site. I am not experiencing this in my dev environment, and only in my hosted one.

    I have simply taken the Personal Web Site starter kit set it up on my dev machine and then also set it up in a hosted online environment.

    The main menu (ASP:Menu control), when doing a mouse over is attempting to call Menu_HoverRoot(this). Debugging the issue comes up with the issue being the Menu_HoverRoot call. Being a .Net 2.0 control, I'm not sure where to look for the fix.

    Has anyone seen this, figured it out and are able to shed light on the fix for me?

    Any help would be appreicated.

    Monday, July 17, 2006 9:32 PM

Answers

  • User-555341274 posted

    Fixed! It turned out to be something I had run in to previously in a very different situation (PHP).  It just took a while to correlate the underlying symptoms to the actual cause.  The details were pretty simple in retrospect, but not obvious due to a number of factors (Shrek says, "Browsers are like onions... they have layers.")
     
    In a nutshell, the embedded resources (like the linked JavaScript files) get delivered to the browser via an ASP.NET 2.0 feature that uses WebResource.axd (the actual blah.js files get embedded in to the compiled application).  The problem was that WebResource.axd doesn't actual exist in the site (your web-application), the 2.0 DLL that is script mapped to .AXD files knows what it is and handles it... but NOT when the script mapping (IIS/Website/Properties, Home Directory, Configuration, Application Extensions, .axd) has "Verify that file exists" checked.  On our server, this is off by default in the IIS master properties, so I cannot explain why it was checked for that website.  We'll have to watch for this in the future.
     
    I hope this saves someone else quite a bit of time debugging and fixing an issue with very few clues that lead back to the cause.  Cheers - Jeremy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 14, 2006 3:44 PM

All replies

  • User-555341274 posted

    I am having the exact same problem.  It appears to be a server side issue.  The nav menu is working on the development workstation (local), but when I move the site/app to the live server, I simply get the "Object Expected" JavaScript error.

    I have removed and re-registered .NET 2.0 on the site.  I repaired the .NET Framework 2.0 and rebooted the server, no change.

    Anyone else seen this and/or have some suggestions as to what the problem might be?

     Thanks - Jeremy

    Monday, September 11, 2006 11:35 AM
  • User-555341274 posted

    Fixed! It turned out to be something I had run in to previously in a very different situation (PHP).  It just took a while to correlate the underlying symptoms to the actual cause.  The details were pretty simple in retrospect, but not obvious due to a number of factors (Shrek says, "Browsers are like onions... they have layers.")
     
    In a nutshell, the embedded resources (like the linked JavaScript files) get delivered to the browser via an ASP.NET 2.0 feature that uses WebResource.axd (the actual blah.js files get embedded in to the compiled application).  The problem was that WebResource.axd doesn't actual exist in the site (your web-application), the 2.0 DLL that is script mapped to .AXD files knows what it is and handles it... but NOT when the script mapping (IIS/Website/Properties, Home Directory, Configuration, Application Extensions, .axd) has "Verify that file exists" checked.  On our server, this is off by default in the IIS master properties, so I cannot explain why it was checked for that website.  We'll have to watch for this in the future.
     
    I hope this saves someone else quite a bit of time debugging and fixing an issue with very few clues that lead back to the cause.  Cheers - Jeremy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 14, 2006 3:44 PM
  • User1458092160 posted

    Well, I wish I hadn't spent the past few days trying to figure this one out, but I'm SO glad I found your post!  I have THREE different webapps I'm working on right now that all were getting these weird javascript errors and turning off the "Verify that file exists" for axd files fixed all three of them.  THANK YOU!

    eddie

    Tuesday, September 19, 2006 6:31 PM
  • User74816880 posted
    This has saved me from a whole lot of headaches,thank you dude!
    Thursday, December 7, 2006 5:53 AM
  • User-1255446095 posted

    Hello

     

    I am running in to the same error in asp.net 2.0 application using asp:menu control. I checked the IIS as pointed but the verify file exists is not checked but it still shows me a java script erorr.

    Can any one point out the cause.

     

    Thanks!!

    Radhika

     

     

    Wednesday, January 10, 2007 4:06 PM
  • User382643186 posted

    Thanks jeremyf !

    That save alot of time debugging.

    For others.  This is how I solved the problem:

    1. Went to my remote server and opened the IIS manager.
    2. Right mouse click on the website and selected Properties.
    3. Selected the Home Directory Tab.
    4. Clicked on Configuration button.
    5. Selected the .axd line in the Application extensions list box and click on the Edit button.
    6. Changed the Executable Path to point to the v2.0 aspnet_isapi.dll.
    7. Stopped then Started the website and all is well.

    EZ

     

     

     

    Wednesday, January 17, 2007 3:28 AM
  • User-1270101282 posted

    I'm experiencing the same problem on my site, everything is perfect on my Dev box but since hosting it on a Remote Server (which is a clunky old windows2000 box used for testing) I'm getting the 'Object Expected error' however it's not happening on the mouseover of the menu but appearing as a an 'Error on Page' on page load. Also the menu control expand icons (arrows) are displayed as a red X (image placeholder) and the dropdown/expand functionality fails to work.

    I've check everything on IIS asper Jeremyf's post ----- .asd extension is pointing to v2.0 aspnet_isapi.dll and 'verify file exists' is not checked.

    I've just installed the .NET 2.0 Framework SP1 with my fingers crossed that there'd be a fix for this issue in there....but still experiencing the same issue

    Any other ideas or suggestions would be much appreciated

     

     

     

     

    Wednesday, January 17, 2007 6:56 PM
  • User-1270101282 posted
    oops.....the error is ONLY occuring on the mouseover...my mistake.
    Thursday, January 18, 2007 5:10 PM
  • User-2071049874 posted

    Thanks.  Unchecking file exists fixed my problem as well.  We have exchange running on the same machine.  I had a problem with OWA which I reinstalled (it recreates OWA forders in IIS) and it might also reset some metafile settings.  I am pretty sure this problem started after that.  

     Thanks again.  I also spent a good day stying to figure out this problem.

    Thursday, May 24, 2007 9:14 PM
  • User1039459097 posted

    Hi EveryBody


    Finally I have overcome this issue !!!? As the other Person , i did every thing on my HOST settings, even unchecking the [Verify that file exists] option
    But i couldn't solve the problem and still i was faced with the [Object Expected] error when OnHover event was fired for my ASP:Menu control.
    Also i experienced the same problem with TreeView Control on my .ASPX page

    Following is what i did by chance and above problem resolved successfully
    I assume you have a page with ASP:MENU or TreeView Control placed on it so try:

    1) First of all allow your page Rendered from the Server Completely
    2) From your Browser toolbar (in my case IE) save your Page with a name as you wish in [HTML] format BUT not .mht or single .html file
    3) now as you can see IE has created a file and a folder in which you can find all your page stuff there
    4) if you look at carefully you will find a file named [webResource.axd] in this folder ....that's it !!!
    5) Now put this file beside your page on the FTP on your HOST and then you will never get that JavaScript Error !!!!

    Thanks God

     

    Wednesday, November 21, 2007 10:47 AM
  • User-1239044339 posted

    My problem was as described (dev worked fine, prod errored on hover). My fix was slightly different. The axd extension wasn't listed on my production server in the Application Extension Mapping, and once it was added my menu worked fine. What a hassle that is finally resolved.

    Thanks...

    Friday, May 9, 2008 3:40 PM
  • User1838111175 posted

    I am having a similar problem, except production works fine.  In development, I get the Object Expected error when I hover over a menu item, or when the page loads.  (Sometimes is nagging about a missing ')'.)  If I hit Refresh a few times, then it goes away.  It doesn't happen every single time, but maybe 50% or more.  Extremely annoying, and makes testing a giant pain in the neck.

    This didn't happen when I originally did the development, which was probably before I started using Ajax.  But now it does it on the 2 sites I have developed that use the asp menu control.

     Anyone know how to fix this for development?

    Monday, May 19, 2008 9:13 AM
  • User-204582866 posted

    I have tried all options mentioned in the above fix ,still same error , did anybody  has come across with solution

    Wednesday, October 8, 2008 11:43 AM
  • User-1712210582 posted
    Hello everybody, I have tried all this but no luck. Is there any other way to fix it please tell me.
    Thursday, October 23, 2008 8:21 AM
  • User-1385068046 posted

    Same problem here. UsingVWD 2008 and tried all solutions, still the infamous Object expected.

    I have been looking for a solution for 3 hours, now I'll give up. I wont use those options in a master page.

    Documentation should say "SOME CONTROLS MAY FAIL IN MASTER PAGE, WE DON'T HAVE AN SPECIFIC SOLUTION. TRY HOURS LOOKING, AND IF YOU ARE LUCKY, MAYBE YOU WILL SOLVE THIS".

     

    Wednesday, October 29, 2008 5:39 PM
  • User-1712210582 posted

     There are some browser settings as well which will stop this error from displaying. So try that out. I have done the same. the error come but it is displayed in left corner of the browser window. So try this out too.

    You might have some luck.

    Thursday, October 30, 2008 3:03 AM
  • User491574966 posted

    Hi,

    My webhost refuses to configure a mapping to application extension .axd. They say it may harm other sites on the server because it has impact for all sites. Now I am not an expert on IIS6/7, but I would say this is incorrect and there should be a mapping to .axd by default when hosting Asp.Net 2.0.

    Can anyone who is more into IIS tell me whether I am wrong about this? Is this webhost perhaps right and should I accept that I cannot deploy a website with standard stuff like asp:menu en asp:treeview controls in it that will actually work? I need to advise my customer about this webhost.

    Many thanks in advance.

    Friday, November 14, 2008 2:34 PM
  • User-1712210582 posted
    May i know exactly when u r facing this problem??
    Saturday, November 15, 2008 8:38 AM
  • User491574966 posted

    May i know exactly when u r facing this problem??

    This has been recently, november 2008. Or do you mean in which case the problem occurs? It occurs, as described in this thread, when WebResource.axd/JScript is called by asp.menu control.

    Monday, November 17, 2008 6:30 AM
  • User416475258 posted

    Hi Jereme,

     
    I am also getting the same problem.  I tried as you suggested.    But i didnot get any result.  Here, i just have created user control and placed menu control on that.  I just added the user control to aspx page.  It was running fine in the morning.  But from evening, it is throwing "Object Required".  The error is coming when i move the mouse on the menu.  Besides the menu i am getting the message called "Expand".  Could any one please let me know what can be the solution.

     

    Thanks & Regards,

    Kiran

    Tuesday, December 23, 2008 2:02 PM
  • User242716181 posted

    Well I hit this problem also.  One day it was working and the next it wasn't.  I asked myself what had changed.  Like most users my answer was nothing. :)

    After reading through these posts, trying different things, I was still receiving the same error.  So back to basics.  So I created a new web project and started from scratch to see if I could reproduce the problem.  I was able to reproduce the problem and discovered the issue.

    Page Authorization.  I had change the default authorization to the following:

    <authorization>
      <
    deny users="*"/>
      <
    deny users="?"/>
    </
    authorization>

    and added the appropriate <location> statements to authorize all the pages except for one very important file WebResource.axd

    Once I added a location tag to authorize access to the WebResource.axd file my menu control started working properly with the dynamic popouts being displayed on mouse over.

    Hope this helps others experiencing this issue.

    DEP

    Tuesday, February 3, 2009 4:17 PM
  • User-1995421665 posted

    This is driving me absolutely insane.  Here is what I have:

    I have two projects on my computer.  Visual Studio 2008.  They are almost identical, it's just that one is not as up-to-date as the other.

     The one I want to work, the menu pop-ups do not work at all. (Project 1)

    On the one that is older, the popups work every time. (Project 2)

    So what I did was slowly copy over the old files (Project 2) with the new ones (Project 1).  Just the aspx pages, not vbproj, sln, etc...  This way, I'll just use Project #2 as my main one.  The menu popups work fine for a couple of hours.  Then they stop working just like the first project. 

    I've even saved copies as I went along to try and narrow it down, but there is not one single thing that causes the menu to stop working.  If I revert back to a 'mid-convert' copy, the menu will not work.  I have to revert all the way back to the old project which still works.

    Can anyone help?  Please??? :)  I've blown about a week on this already.

    Wednesday, April 1, 2009 1:06 PM
  • User242716181 posted

    Errors like this can be very frustrating.  Are you using security pruning with a membership provider?  Have you used file level permissions or restricted access to pages by adding location authorization tags in your web config file?

    Wednesday, April 1, 2009 3:50 PM
  • User-1995421665 posted

    It is very plain jane.  I'm not doing anything fancy like that.  It is a project that was written in VS2003 and upgraded to VS2008. 

    This is what I did yesterday:

    Made a brand new project and started adding the upgraded aspx pages to it.  The menu control worked as I went along all the way to the end.  I even added 2008 infragistic menu control to see if it still works in case I need to revert back to it.  Everything was just dandy.

    Today:

    I open the project and run it using my local IIS. Menu is not working.  I drop Infragistics back in and try again.  Neither menu controls work.  Both error with object expected.  I excluded all files except for the default/login,etc.., took out all css files, all js files and it still doesn't work.  It's like once it stops working, it stops working for good.  Tried opening it in Firefox too, got same result.

    All my other sample projects with both menus still work fine. Also when I publish to the prod. server, the main one's menu does not work on it.  The sample one works on the prod. server.

     The time thing is throwing me.  I can't figure out why it will work up to a point and then stop with no change to the project being made.

    Friday, April 3, 2009 12:51 PM
  • User-1995421665 posted

    Something else I noticed on the server I published to:

    I created a website. Set the port to 8081 and created a new app. pool.  Published the project to this website.

    If I browse the app. from IIS on the server it works ('localhost' shows up in the web address).
    If I open a browser and type http://:appname:8081 it does not work.
    If I open a browser and type http://localhost:8081 it works.

    Something about localhost?  I don't even know what questions to ask.

    Friday, April 3, 2009 5:05 PM
  • User-1995421665 posted

    And it gets better.  I took out global.asax and it worked fine from anywhere.  So I put it back in and started taking pieces out.  The one thing that was killing it was Application_AcquireRequestState.  I put that code in to reset a session variable that I use throughout the app. to run javascript on page load.

    SO...Application_AcquireRequestState in the Global.asax = bad for menu controls. Now to figure out why and how I can work around it...

    Friday, April 3, 2009 6:26 PM
  • User-1674094426 posted

     Just Format your system and do it will work.. even i also got same error but struggled lot finally formated my system n again installed VS :)  

    Wednesday, January 13, 2010 3:42 AM
  • User-1368651969 posted

    If you are finished with trying all above,

    then there could be a problem with the installed patches.

    So try repairing or re-installing .NET Framework.

    Sunday, February 28, 2010 11:36 PM
  • User1306849269 posted

    hi i have the same problem.. one server with two websites.. one works OK and the other with same code and same  iis configuration it's wrong...

     

    Wednesday, March 3, 2010 11:40 AM
  • User-1368651969 posted

    First you try with installing AJAX for ASP.NET 

    http://www.asp.net/Ajax/Documentation/Live/InstallingASPNETAJAX.aspx

    if everything is working, thats fine

    but , if you menu start working partially

    it's better repair .NET Framework


    Wednesday, March 3, 2010 12:11 PM
  • User282198657 posted

    Our load balanced sharepoint farm using IE we were intermittently getting a ie "Microsoft JScript runtime error: Object expected" error on mouse over of top link bar.  Debugging pointed to Menu_HoverStatic(this).

    Fixed it by setting Machinekey/validationkey/decryptionkey nodes to same value (which they weren't) in web.config for sharepoint servers.

    http://www.rosshawkins.net/archive/2006/10/08/webresource.axd.aspx

    Friday, September 10, 2010 3:25 PM