I am using a 3rd party javascript in my MVC application. The javascript displays an interactive calendar for user to enter date and time from the mouse click.
vCalTime+="<td align='center'><table cellspacing='0' cellpadding='0' style='line-height:0pt'><tr><td><img onmousedown='startSpin(\"Hour\", \"plus\");' onmouseup='stopSpin();' src='../../images/cal_plus.gif' width='13px' height='9px' onmouseover='changeBorder(this, 0)' onmouseout='changeBorder(this, 1)' style='border:1px solid white'></td></tr><tr><td><img onmousedown='startSpin(\"Hour\", \"minus\");' onmouseup='stopSpin();' src='../../images/cal_minus.gif' width='13px' height='9px' onmouseover='changeBorder(this, 0)' onmouseout='changeBorder(this, 1)' style='border:1px solid white'></td></tr></table></td>\n";
The strange thing is that, only in IIS7, all the navigation in the calendar is captured by the MVC routing engine as controller method but from the user machine the page and calendar work fine. It’s just that I got a lot of email notifications by ELMAH. I can filter the error but I just wonder if this is really an error. Below is what is trapped by ELMAH. Does anyone know what might cause the problem? Thank you.
System.Web.HttpException: A public action method 'images' was not found on controller 'MYAPP.Controllers.ControllerNameController'.
Generated: Fri, 10 Aug 2012 16:11:13 GMT
System.Web.HttpException (0x80004005): A public action method 'images' was not found on controller 'MYAPP.Controllers.ControllerNameController'.
at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Server Variables
Name Value
**ALL_HTTP** HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:en-us HTTP_AUTHORIZATION:Negotiate TlRMTVNTUAADAAAAGAAYAIAAAADMAMwAmAAAAAoACgBIAAAAGAAYAFIAAAAWABYAagAAAAAAAABkAQAABYKIogUBKAoAAAAPVgBIAEEAMgAwAFYASABBAFAATwBSAFQARQBFAE4AWQBUAFAATwBSAC0AVwBTADkANwA3ADMAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPBnHWzuV8BTujt2KHowUjAQEAAAAAAAAIhjfDEnfNAQz9aC9ImrcDAAAAAAIABgBSADAAMQABABYAUgAwADEAUABPAFIAVwBFAEIAMAA1AAQAHAByADAAMQAuAG0AZQBkAC4AdgBhAC4AZwBvAHYAAwA0AFIAMAAxAFAATwBSAFcARQBCADAANQAuAHIAMAAxAC4AbQBlAGQALgB2AGEALgBnAG8AdgAFAAwAdgBhAC4AZwBvAHYABwAIAAiGN8MSd80BAAAAAAAAAAA= HTTP_COOKIE:ASP.NET_SessionId=ar4sal4yoyuynber4e0gaanm HTTP_HOST:HostingServer
**HTTP_REFERER**: HostingServer/MYAPP/ControllerName/Create/99999999/NoneOfTheAbove HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; MS-RTC LM 8; .NET4.0E) HTTP_UA_CPU:x86
**ALL_RAW** Connection: Keep-Alive Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-us Authorization: Negotiate TlRMTVNTUAADAAAAGAAYAIAAAADMAMwAmAAAAAoACgBIAAAAGAAYAFIAAAAWABYAagAAAAAAAABkAQAABYKIogUBKAoAAAAPVgBIAEEAMgAwAFYASABBAFAATwBSAFQARQBFAE4AWQBUAFAATwBSAC0AVwBTADkANwA3ADMAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPBnHWzuV8BTujt2KHowUjAQEAAAAAAAAIhjfDEnfNAQz9aC9ImrcDAAAAAAIABgBSADAAMQABABYAUgAwADEAUABPAFIAVwBFAEIAMAA1AAQAHAByADAAMQAuAG0AZQBkAC4AdgBhAC4AZwBvAHYAAwA0AFIAMAAxAFAATwBSAFcARQBCADAANQAuAHIAMAAxAC4AbQBlAGQALgB2AGEALgBnAG8AdgAFAAwAdgBhAC4AZwBvAHYABwAIAAiGN8MSd80BAAAAAAAAAAA= Cookie: ASP.NET_SessionId=ar4sal4yoyuynber4e0gaanm Host: HostingServer
**Referer**: HostingServer/MYAPP/ControllerName/Create/99999999/NoneOfTheAbove User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; MS-RTC LM 8; .NET4.0E) UA-CPU: x86
**APPL_MD_PATH** /LM/W3SVC/2/ROOT/MYAPP
**APPL_PHYSICAL_PATH** E:\HostingServer\MYAPP\
**AUTH_TYPE** Negotiate
**AUTH_USER** DOMAIN\USERNAME
**AUTH_PASSWORD**
**LOGON_USER** DOMAIN\USERNAME
**REMOTE_USER** DOMAIN\USERNAME
**CERT_COOKIE**
**CERT_FLAGS**
**CERT_ISSUER**
**CERT_KEYSIZE**
**CERT_SECRETKEYSIZE**
**CERT_SERIALNUMBER**
**CERT_SERVER_ISSUER**
**CERT_SERVER_SUBJECT**
**CERT_SUBJECT**
**CONTENT_LENGTH** 0
**CONTENT_TYPE**
**GATEWAY_INTERFACE** CGI/1.1
**HTTPS** off
**HTTPS_KEYSIZE**
**HTTPS_SECRETKEYSIZE**
**HTTPS_SERVER_ISSUER**
**HTTPS_SERVER_SUBJECT**
**INSTANCE_ID** 2
**INSTANCE_META_PATH** /LM/W3SVC/2
**LOCAL_ADDR** 10.165.50.180
**PATH_INFO** /MYAPP/ControllerName/images/cal_minus.gif
**PATH_TRANSLATED** E:\HostingServer\MYAPP\ControllerName\images\cal_minus.gif
**QUERY_STRING**
**REMOTE_ADDR** 10.10.60.17
**REMOTE_HOST** 10.10.60.17
**REMOTE_PORT** 3410
**REQUEST_METHOD** GET
**SCRIPT_NAME** /MYAPP/ControllerName/images/cal_minus.gif
**SERVER_NAME** HostingServer
**SERVER_PORT** 80
**SERVER_PORT_SECURE** 0
**SERVER_PROTOCOL** HTTP/1.1
**SERVER_SOFTWARE** Microsoft-IIS/7.5
**URL** /MYAPP/ControllerName/images/cal_minus.gif
**HTTP_CONNECTION** Keep-Alive
**HTTP_ACCEPT** */*
**HTTP_ACCEPT_ENCODING** gzip, deflate
**HTTP_ACCEPT_LANGUAGE** en-us
**HTTP_AUTHORIZATION** Negotiate TlRMTVNTUAADAAAAGAAYAIAAAADMAMwAmAAAAAoACgBIAAAAGAAYAFIAAAAWABYAagAAAAAAAABkAQAABYKIogUBKAoAAAAPVgBIAEEAMgAwAFYASABBAFAATwBSAFQARQBFAE4AWQBUAFAATwBSAC0AVwBTADkANwA3ADMAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPBnHWzuV8BTujt2KHowUjAQEAAAAAAAAIhjfDEnfNAQz9aC9ImrcDAAAAAAIABgBSADAAMQABABYAUgAwADEAUABPAFIAVwBFAEIAMAA1AAQAHAByADAAMQAuAG0AZQBkAC4AdgBhAC4AZwBvAHYAAwA0AFIAMAAxAFAATwBSAFcARQBCADAANQAuAHIAMAAxAC4AbQBlAGQALgB2AGEALgBnAG8AdgAFAAwAdgBhAC4AZwBvAHYABwAIAAiGN8MSd80BAAAAAAAAAAA=
**HTTP_COOKIE** ASP.NET_SessionId=ar4sal4yoyuynber4e0gaanm
**HTTP_HOST** HostingServer
**HTTP_REFERER** HostingServer/MYAPP/ControllerName/Create/99999999/NoneOfTheAbove
**HTTP_USER_AGENT** Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; MS-RTC LM 8; .NET4.0E)
**HTTP_UA_CPU** x86
Powered by ELMAH, version 1.1.11517.2009 (debug; RC; net-3.5). Copyright (c) 2004-9, Atif Aziz. All rights reserved. Licensed under Apache License, Version 2.0.
The problem is solved. The js script is using the relative path for the images that used as navigation buttons in the calendar. When the application is deployed in another server the imaging files are not found using the relative path. I created a javascript global variable in the Site.master as
and in the .js I use it instead of the hard coded relative path (../../).