MVC2 - MicrosoftMvcAjax.js

Discussion in 'Visual Studio' started by larrymol, Feb 4, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. In my development environment, VisualStudio2010, I have an MVC2 app that makes a JavaScript call as shown below.

    public ActionResult SignInA1()
    {
    return JavaScript("SetSignInPageTitle()");
    }

    It works as expected locally in VisualStudio, however when I deploy to Discountasp.net I get a 'Sys is not defined' in Firebug.

    These are the two js files responsible for mvc ajax and I've tried moving them
    around and still keep getting the same error, only when I deploy to Discountasp.net.

    <script type="text/javascript" src="../../../Scripts/MicrosoftAjax.js"></script>
    <script type="text/javascriptsrc="../../../Scripts/MicrosoftMvcAjax.js"'></script>

    Any idea's as to why this is happening ?

    Thanks in advance.
     
  2. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    I'm guessing since I can't tell if you're using the .. to mask the path, but double check that the absolute/relative path is correct. We provide an absolute path through your Control Panel.
     
  3. I'm not familiar with the two js files you've mentioned. I do know that in traditional MS AJAX where a script manager is included in the page, 'Sys' refers to a client side namespace that gets included by the framework with ScriptResource.axd <script/> tags. When the ScriptResource.axds' fail to get rendered, it leads to 'Sys is not defined' exceptions.

    Perhaps have a think about which version of IIS you test with on local and then compare that to the version of IIS you're deploying to on the DASP server?
     
  4. Solution

    Changing this:
    <script type="text/javascript" src="../../../Scripts/MicrosoftAjax.js">
    </script>
    <script type="text/javascript" src="../../../Scripts/MicrosoftMvcAjax.js"> </script>

    To this:
    <script type="text/javascript" src="/Models/Scripts/MicrosoftAjax.js"> </script>
    <script type="text/javascript" src="/Models/Scripts/MicrosoftMvcAjax.js"> </script>

    Did the trick, thanks for the idea.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page