BUG: "Remote Scripting Error" When Using Page Object DTC

ID: Q197355


The information in this article applies to:
  • Microsoft Visual InterDev, version 6.0


SYMPTOMS

When you execute a remote script using the Page Object design time control and passing a string containing the characters "/" and ".", the string might be altered or you might receive the following error:

Remote Scripting Error
REMOTE SCRIPTING ERROR: Page invoked does not support remote scripting.


CAUSE

The string that is passed is interpreted as a path and actually executed as a path. For example:


"/../" causes the remote scripting error.
"/./" is changed to "/", as well as any repeat of this pattern.
For example, "/./././././" is changed to "/". 

In addition, the path is opened, which might cause the remote scripting error if the path points to a location outside of the application scope.


RESOLUTION

Write a function that converts all "/" characters into some nonprintable character before passing the string and change it back after the function is called.

For example:


<script language="JavaScript">

function Encode_String(x){
  // Changes the "/" character to the nonprintable ascii code 1.
  x=x.replace(/([/]*)+/g, String.fromCharCode(1));
  return x;
}

function Decode_String(x){
  // Converts the string in the above function back to its original
  // form.
   var re = new RegExp('(['+ String.fromCharCode(1)+ ']*)+', 'g');
   x=x.replace(re, "/");
   return x;
}

</script> 


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create Page objects on two Active Server Pages (ASP) Web pages.


  2. Add a reference from the first page object to the second by doing the following:

    1. Right-click the first page object DTC.


    2. Click the References tab.


    3. In the Existing references list, add the name of the Page Object DTC existing in the second page.




  3. Add a function, like the one listed below, to the second page:
    
    <script language=JavaScript runat=Server>
       function function_name(str){ return str; }
    </script> 


  4. In the first page, add the following code:
    
    <script language=JavaScript>
       Page2.execute.function_name('/../');
    </script> 


NOTE: In this case, "Page2" is the name of the Page DTC on the second ASP page.

Keywords : kberrmsg kbVisID600bug kbGrpASP kbInetDev
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: May 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.