Asked by:
Change ScriptResource.axd path

Question
-
User-135410963 posted
Hello everyone,
I'm running a web application (.Net 3.5) through a gateway[1]. This gateway changes my application path.
Example:
- Web Application Path: http://webserver/ApplicationName
- Gateway Path: http://gateway/
- Web Application through Gateway Path: http://gateway/http%3B/webserver/ApplicationName
My problem is ASP.NET Ajax is trying to get Its scripts from a wrong path.
Error message example:
<quote>Error: [Exception... "'Sys.ScriptLoadFailedException: Sys.ScriptLoadFailedException: The script 'http://gateway/ApplicationName/ScriptResource.axd?d=pXGxsCxfFpN7YoDKJe9ANJUGdhhEYXdDvlJNvZyr3dWA3jxhYKmHBTZXvAXPr8NFAZhv6MOINf4Ktd7XCgzHFg2&t=633372084573906250' failed to load. Check for:
Inaccessible path.......
</quote>Question:
Is there a way to specify where the application (ScriptManager) should get its scripts from? I tried modifying ScriptResource handlers in Web.Config without success.
This errors occurs only with some scripts, like the one mentioned before (webuivalidatoin.js I think) or this one [2].
Everything else works fine. I just avoid using absolute paths everywhere.
Thanks in advance for any help!!
Manuel
------------------------------------------------------------------------------------------------------------------------------------
[1] It's a BEA System PlumTree Gateway, JFYI.
[2] timer.js maybe? ScriptResource.axd?d=Xw_t6hDimiqKG8vy7JFzY0XmfYWsbC_McnHAj4s_06xVvXlPDPGz4yARlIafsq-NHWeIbDR3XuS9nH5fSeNxJA2&t=633403791412078750
Tuesday, April 8, 2008 11:27 AM
All replies
-
User-1810271211 posted
I am having this exact problem with .net 3.5 and a Portal/Gateway.
I get do also have a timer on my pages, I'm going to remove the timer, test the other update panels and post my results.
Our portal is a Novell product I'm pretty sure.
The Gateway/Portal successfully edits the HTML to contain the proper link to the script file http://gateway/http%3B/webserver/ApplicationName. However I get the same error stated above.
Please anyone help us.
Monday, April 14, 2008 3:59 PM -
User503670473 posted
Another case here, same exact issue. We are running BEA AquaLogic (formerly known as plumtree) and all of my *.axd files are getting 404's. I know why, the js is returning the fqdn of the front server, but the application resides on a "portlet" server which the fqdn is obviously different. What we require is a way to specify a fqdn in which the ScriptManager/Resources (*.axd) will use when generating their paths.
Does anyone know how to do this, solutions?
Thanks
Thursday, July 3, 2008 3:23 PM -
User503670473 posted
bump.
Monday, July 7, 2008 12:47 PM -
User-1405953293 posted
Hi All,
I am also facing similar problem,if any one got solutions please reply.
Thanks
Reddy
Tuesday, July 8, 2008 3:01 PM -
User-1810271211 posted
I wish I could be of more help, I can remember this being an terribly annoying problem. I couldn't find any help and I searched all over the internet.
This is pretty old and memory is a little hazy, but I went back and looked at my code and here's my advice:
Your script manager should create links to several (or possibly one) different ScriptResource.axd files with different query strings or whatever appended to them. Figure out which one is causing your error first. This is what I did, and when looking at the code contained in that file, I realized it was realated to my Ajax Timer. If I comment my AJAX timer, everything on the pages works flawlessly. And there are references to other ScriptResource.axd files that work properly. My solution was to write my own timer functionality. And as far as I remember I didn't get the error message until after the timer event triggered, and tried to update via AJAX.
Basically, determine what component is causing your problem (if you have an AJAX timer, it's that), and remove that component and create one that does the same thing on your own. Sorry.
Thursday, July 10, 2008 4:00 PM -
User-135410963 posted
Thanks everyone for your comments.
The problem are Ajax Control Toolkit Extenders. I give up with this.
Thursday, July 10, 2008 4:31 PM -
User-1810271211 posted
Isn't it very possible that your problem is related to the timer, as your previous post states that you had an issue with timer.js? The timer really isn't very complicated and you can write your own timer in javascript.
Friday, July 11, 2008 4:06 PM -
User-709807128 posted
Did anyone ever figure out any solution to this?
I am having the exact same issue trying to use the AutoComplete .NET AJAX Control Extender and the BEA ALUI Portal 6.5 (formerly Plumtree).
Everything works great on my machine, until you access the .aspx page via the portals "gatewayed" link. Then the AutoComplete extender caueses weird errors. I know this because when I remove the AutoComplete and just use normal Update Panels everything works okay.
The weird thing is the AutoComplete works, just not in conjunction with the UpdatePanels. I am using the UpdatePanels to dynamically add additional textbox controls with AutoComplete functionality.
However, I notice when I use the UpdatePanel to do anything, if an AutoComplete is on the page (even if it wasn't dynamically added) it causes the same "ScriptResource.axd cannot be located" error stated above. This of course is only when the page is "gatewayed" in the portal.
Wednesday, August 20, 2008 11:49 AM -
User656203221 posted
I certainly don't have any answers for you; but I am equally interested in an answer if anyone has one. I'm currently running Aqualogic 6.0sp1 (WebCenter if you follow the Oracle name) and we will be looking to upgrade our portal next year to v6.5 (hopefully the search issues are ironed out from v6.1).
Thursday, August 28, 2008 8:08 PM -
User-2018371349 posted
I'm interested too in a solution for this problem. I've a reverse proxy mapping from the path /theWeb/default.aspx to /theSecureWeb/default.aspx... But the references to the Script- and WebResource.axd is still /theWeb/default.aspx...Wednesday, October 1, 2008 9:34 AM -
User-1138367807 posted
Let me give my two cents. Are the websources hard coded in the application? If so, can it be programmed to get the correct gatewayed URL?
Not in this context, but in various other projects where it involves a webservice I have always set the URL from application/config files.
Friday, October 17, 2008 2:54 PM -
User-1138367807 posted
Let me give my two cents. Are the websources hard coded in the application? If so, can it be programmed to get the correct gatewayed URL?
Not in this context, but in various other projects where it involves a webservice I have always set the URL from application/config files.
Friday, October 17, 2008 3:01 PM -
User-709807128 posted
The websources - such as ScriptResource.axd - by default point to the root of the web application, for example:
http://server1name/portal/server.pt/gateway/PTARGS_0_16064_2841_0_0_43/http%3B/server2name/AjaxStaticScriptsTest/ScriptResource.axd?d=yE9C-GOhYZoqZM-DihaYmMbyGoqdCfkBfGdlmEFUj3ujsTuqLwq5PXwca7raBhfG-S7cuxYuzVql4aQ0HUKpuMhhQgi8CaRo8ROA_WOUsHx392pUl-SnQvp9iJDwNB4H0&t=633548457054250472
Where "server1name" is the name of the BEA portal server, "server2name" is the name of the server where the .net code lives, and "AjaxStaticScriptsTest" is the name of the web application name in IIS.
As you can see, it appears to be gatewayed properly on the initial loading of the page. But as soon as you do any kind of postback (ajax running on the client) it breaks and I get the above error about "ScriptResources.axd failed to load. Check for inaccessible path".
Again, this is ONLY when I try to use the UpdatePanel to dynamically add AjaxControlToolkit AutoComplete Extenders to dynamically added textboxes, and the page is gatewayed.
If I only use UpdatePanel (no AutoComplete) or use AutoComplete only on textboxes not dynamically added to the page, works fine. Combine the two, and the error is the result.
I would like to try setting the URL to the ScriptResource.axd file from the application/config file (I assume you mean web.config). However, I have no idea how to do this. Any attempt I make to do this breaks everything.
Do you know how to properly set the URL from the application/config file? If you could show me how you normally do this, that would be great.
Friday, February 6, 2009 4:24 PM -
User-365422915 posted
Did anyone come up with a solution to this problem within the Oracle Portal? I am having the same issue.
Friday, March 6, 2009 10:59 AM -
User-709807128 posted
I banged my head enough and actually came up with a solution this this. It's kind of goofy but it's the only thing that I can find that works:
1) You need to stop using the dynamically generated script files (ScriptResource.axd) and instead, reference the static .js files for both "System.Web.Extensions" and the Ajax Control Toolkit. Here's a helpful article that showed me how to do this:
If you follow this article (remember it depends on the version of the Ajax Control Toolkit you are using, I am using version 1.0.20229.20821 which is the last version of the 2.0 Toolkit - you can get these from http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=11121), put the static .js files in the root of your web app in a "Scripts" folder the way the article above says, and add this "ScriptPath" attribute to the <ScriptManager> tag on the rendered page and see that the page is now referencing the static .js files.
2) If the page is gatewayed, the only other step is (and this is kind of hacky) but you must parse out the fully qualified gatewayed link to your page and use it to programatically RESET the ScriptPath attribute to your static .js files in the root of your Web App every time the page loads to the value of the fully qualified gatewayed link (put it in the Page_Load() function so it runs every time, postback or not).
I did this by parsing out the gatewayed link from the portal's "HTTP_CSP_GATEWAY_SPECIFIC_CONFIG" header variable. Inside this is a parameter of PT-Hostpage-URI which contains the address of the gatewayed page.
Parse this out, and reset it every time in the Page_Load() function. It never changes, but somehow the .NET app loses its reference to this when gatewayed - hence our error. So I re-apply it every time, and presto, I can use the Standard .NET Ajax Extensions with the Ajax Control Toolkit like I described above (using UpdatePanel to dynamically add AutoCompleteExtenders to Textboxes).
So, for example, on every Page_Load(), I am resetting the ScriptPath to:
Where PortalServerName is the name of my portal server, and ExternalCodeServerName is the server where the .NET code lives.
I know this may be a little confusing, but it does work for me. Hopefully it will work for you.
Monday, March 9, 2009 1:02 PM -
User-365422915 posted
Thank you, this works great for .NET applications that I am bringing in and displaying in the portal through Hosted Display Mode.
However, using the same app that works in Hosted Display Mode doesn't work correctly if I am bringing it into a smaller portlet on a page (Hosted Display Mode off, inline refresh on/off) . The PT-Hostpage-URI in this way is in a completely different format, and doesn't even reference the external code server.
It looks like this "PT-Hostpage-URI=http%u003A%u002F%u002FPortalServerName%u002Fportal%u002Fserver%u002Ept%u003Fopen%u003Dspace%u0026name%u003DCommunityPage%u0026id%u003D94%u0026psname%u003DOpener%u0026psid%u003D93%u0026cached%u003Dtrue%u0026in%u005Fhi%u005Fuserid%u003D95825%u0026control%u003DSetCommunity%u0026PageID%u003D0%u0026CommunityID%u003D8056%u0026"
Tuesday, March 10, 2009 12:07 PM -
User-1043518507 posted
this seems to be mostly working. using fiddler i can see that i'm calling the scripts from the correct location. but on a partial postback in a update panel i'm still getting one call to scriptresource.axd. I'm using Forms Auth and I'm wondering if the BEA/AJAX/Forms Auth combo is adding some extra complexity.Wednesday, March 11, 2009 12:39 PM -
User-709807128 posted
Yeah, I've only used the solution I presented for working with remote portlet .net pages/web apps linked to off the portal, but that still need to be gatewayed for whatever reason. Any deviation from this scenario and I'm not sure if it will still work or not.
I doubt my example will work displayed within the actual portal itself as a portlet. For that, the only thing I know to do to get any AJAX-type behavior to work within a ASP.NET project is use the ALI Portlet Project template that comes with the install of the ALUI .NET Application Accelerator 1.1 (and also install the .NET App Accelerator in the web server where your remote code lives I believe).
The only other way I know to invoke AJAX-like operations on the client from a portlet displayed within the portal itself is to use the "PTHTTPGETRequest" and "PTHTTPPOSTRequest" objects.
http://download.oracle.com/docs/cd/E13158_01/alui/wci/docs103/devguide/apidocs/JSXML/PTHTTPGETRequest.html
http://download.oracle.com/docs/cd/E13158_01/alui/wci/docs103/devguide/apidocs/JSXML/PTHTTPPOSTRequest.htmlBut obviously, neither of these involves using the Standard .NET Ajax Extensions or the Ajax Control Toolkit.
Also, as for the person that posted about Forms Authentication, I am not using this, so I don't know how this affects the example I presented.
Wednesday, March 11, 2009 1:50 PM -
User1743510119 posted
Hi
To resolve this problem use path="~/ScriptResource.axd" instead of path="ScriptResource.axd" in web.config file like this. I have done this and it is working fine. I am accessing my website using IAG gateway.
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="~/ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Happy coding
Sweta Chakraborty
Lead Software Engineer
RMS India Pvt Ltd
Gurgaon (Haryana)
Friday, March 5, 2010 3:07 AM -
User1743510119 posted
Hi
To resolve this problem use path="~/ScriptResource.axd" instead of path="ScriptResource.axd" in web.config file like this. I have done this and it is working fine. I am accessing my website using IAG gateway.
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="~/ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Happy coding
Sweta Chakraborty
Lead Software Engineer
RMS India Pvt Ltd
Gurgaon (Haryana)
Friday, March 5, 2010 3:10 AM -
User-1913773876 posted
I am having the same problem and I already tried the solution above and it did not work for framework 2.0 I also tried the solution that redrum2455 posted and I got a lot of java script errors. I am using NET AJAX Control Extender and the BEA ALUI Portal 6.5 (formerly Plumtree) -Aqualogic 6.0. The postback does not work and I get this error below. I am very interested if anyone has a solution for this problem. thank you
Message: Sys.ScriptLoadFailedException: The script '/ScriptResource.axd?d=HvSNePEIOFsjtLPJ3baZt-hyus6ktOdJ89TEmrWF0jz-OPWCqr0sg-YZTSuqJPSdL8Lyi0LDOuFQhWu99W_ADQ2&t=633398780400000000' failed to load. Check for:
Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
Line: 3311
Char: 13
Code: 0Tuesday, April 20, 2010 4:23 PM -
User-1913773876 posted
I wonder if someone could please help me with this problem.I am using framework 3.5 and ajaxtoolkit 3.0.30930.
I would like to load ajaxtoolkit javascript files from a directory. I download the scripts from here AJAX Control Toolkit - Script Files Only .
Created two subdirectories on my .net project
\scriptsAJAX\System.Web.Extensions\3.5.0.0\3.5.30729.196\
I copied these two files on he above directory: MicrosoftAjax.debug.js and MicrosoftAjax.js
\scriptsAJAX\AjaxControlToolkit
The above folder has all the script files (*js) that i download from ajax control toolkit
Now I set the ScriptPath property on ScriptManager to ScriptPath="~/scriptsajax"
<asp:ScriptManager runat="Server" ScriptPath="~/scriptsajax" EnablePartialRendering="true" ID="ScriptManager1" >
<asp:UpdatePanel ID="UpdatePanel1" runat="server">I have a very sample test page that has DropDownList and CalendarExtender. When I browse the page then I get these errors:
Error: ASP.NET Ajax client-side framework failed to load.
Error: 'Sys' is undefined
Yes I did register <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
Could someone help me to solve this problem.What files is it missing? Thank you
Thursday, April 22, 2010 1:25 PM -
User-1913773876 posted
I wonder if someone could please help me with this problem.I am using framework 3.5 and ajaxtoolkit 3.0.30930.
I would like to load ajaxtoolkit javascript files from a directory. I download the scripts from here AJAX Control Toolkit - Script Files Only .
Created two subdirectories on my .net project
\scriptsAJAX\System.Web.Extensions\3.5.0.0\3.5.30729.196\
I copied these two files on he above directory: MicrosoftAjax.debug.js and MicrosoftAjax.js
\scriptsAJAX\AjaxControlToolkit
The above folder has all the script files (*js) that i download from ajax control toolkit
Now I set the ScriptPath property on ScriptManager to ScriptPath="~/scriptsajax"
<asp:ScriptManager runat="Server" ScriptPath="~/scriptsajax" EnablePartialRendering="true" ID="ScriptManager1" >
<asp:UpdatePanel ID="UpdatePanel1" runat="server">I have a very sample test page that has DropDownList and CalendarExtender. When I browse the page then I get these errors:
Error: ASP.NET Ajax client-side framework failed to load.
Error: 'Sys' is undefined
Yes I did register <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
Could someone help me to solve this problem.What files is it missing? Thank you
Thursday, April 22, 2010 2:09 PM