[RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File-VBForums
Results 1 to 8 of 8

Thread: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

  1. #1

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Hi all, here is my situation:

    I have Server1 and Server2 load balancing - I have an AJAX page that uses an ajax timer to check the status of something and update the UI with results.

    When I run the page specifying Server1 it works fine, likewise if I specify Server2. However, if I don't specify and I let the load balancer determine the server, all is well until one of the ajax postbacks goes to the alternate server - I then get the error message:

    "Sys.ScriptLoadFailedException. The script '/mysite/ScriptResource.axd?d=......" failed to load.


    When I enable script debugging in IE I get:


    "Missing call to Sys.Application.notifyScriptLoaded()"


    I made sure that the machinekeys are the same between both servers and ran a Fiddler trace to see what was going on - and the call to notifyscriptloaded does not occur when the ajax postback is routed to the other server after it has already hit the first server.

    My setup is ASP.net 2.0 on Server2003, the page in question has a masterpage, and the script manager is in the page within a content region.

    Anyone experience this or have a work-around. I don't think there is a way to tell it where to find the ScriptResource.axd file... Thanks for any help!
    Last edited by VBCrazyCoder; Feb 9th, 2009 at 06:54 PM.

  2. #2
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: Ajax / LoadBalancing / and the ScriptResource.axd File

    The /mysite/ seems to be using the virtual directory name in the path. This may mean that you have the same problem as this guy -

    http://plainoldstan.blogspot.com/200...sourceaxd.html

    His solution was to give both paths to the application on both servers the same virtual directory name.

  3. #3

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    Re: Ajax / LoadBalancing / and the ScriptResource.axd File

    I thought that too but my virtual directories are exactly the same on both machines.

  4. #4

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    [Resolved] Re: Ajax / LoadBalancing / and the ScriptResource.axd File

    [RESOLVED] Turns out that .net 2.0 added a "t" parameter to the path for the ScriptResource.axd file, so that had to match across servers.

  5. #5
    New Member
    Join Date
    Jun 2009
    Posts
    2

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    How did you make sure that 't'e paramters are same in all servers.

    Did you add it to another server as well ?

  6. #6

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Since the "t" parameter relates to the LastModifiedDate on the System.Web.Extensions.dll in the GAC, you must make sure that the date matches across the servers.
    You can view the dates using this (which also will show you the path):
    Code:
    Dim strFilePath As String = "C:\WINDOWS\assembly\gac_msil\system.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll"
    			Dim strFilePath2 As String = "C:\WINDOWS\assembly\gac_msil\System.Web.Extensions.Design\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.Design.dll"
    
    			MessageBox.Show("DT: " & File.GetLastWriteTime(strFilePath).ToString() & "  ||  Design file: " & File.GetLastWriteTime(strFilePath2).ToString())
    So just set them both to the exact same datetime and you should be good to go.

  7. #7
    New Member
    Join Date
    Jun 2009
    Posts
    2

    Resolved Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Thank you very much,

    I did find out that modified dates were wrong as the AJAX Control Tool Kit assemblies were in GAC.

    For a solution, I have put them on server's bin directory as copying them in bin directory does not change the modified date.

    Not sure why putting the file in GAC would change the modified date to a date when it was placed there.

    Anyway, I have a solution so its all fine.

    Thanks again for your help

  8. #8
    PowerPoster
    Join Date
    May 2002
    Posts
    24,059

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Because that's the GAC's way of saying "Hey the copy I haver is good as of the date it was dropped into here...." which means it's possible to load an older version of an assembly into the GAC.... ick... the implications of that...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.