Microsoft KB Archive/197355

= BUG: "Remote Scripting Error" When You Use Page Object DTC =

Article ID: 197355

Article Last Modified on 3/16/2005

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q197355



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: 

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; }



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Create Page objects on two Active Server Pages (ASP) Web pages. Add a reference from the first page object to the second by doing the following:

 Right-click the first page object DTC. Click the References tab. In the Existing references list, add the name of the Page Object DTC existing in the second page.</li></ol> </li>  Add a function, like the one listed below, to the second page: <script language=JavaScript runat=Server> function function_name(str){ return str; } </li>  In the first page, add the following code: <script language=JavaScript> Page2.execute.function_name('/../'); </li></ol>

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

Keywords: kberrmsg kbbug kbinetdev kbctrl kbremoteprog kbpending KB197355

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.