Change ScriptResource.axd path

Last post 03-11-2009 1:50 PM by redrum2455. 18 replies.

Sort Posts:

  • Re: Change ScriptResource.axd path

    03-09-2009, 1:02 PM
    • Member
      8 point Member
    • redrum2455
    • Member since 08-20-2008, 11:41 AM
    • Posts 4

    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:

     http://blogs.msdn.com/jorman/archive/2007/05/18/referencing-js-files-for-the-ajax-control-toolkit.aspx

    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:

    http://PortalServerName/portal/server.pt/gateway/PTARGS_0_16064_352_210_0_43/http%3B/ExternalCodeServerName%3B80/MyAjaxWebAppName/Scripts/

    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.

  • Re: Change ScriptResource.axd path

    03-10-2009, 12:07 PM
    • Member
      4 point Member
    • pcrager
    • Member since 06-11-2008, 7:57 PM
    • Posts 2

    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"

  • Re: Change ScriptResource.axd path

    03-11-2009, 12:39 PM
    • Member
      2 point Member
    • nohorse
    • Member since 03-11-2009, 4:35 PM
    • Posts 1
    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.
  • Re: Change ScriptResource.axd path

    03-11-2009, 1:50 PM
    • Member
      8 point Member
    • redrum2455
    • Member since 08-20-2008, 11:41 AM
    • Posts 4

    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.html

    But 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.

      

Page 2 of 2 (19 items) < Previous 1 2