Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I configure my ASP page to be called by remote scripting?

Microsoft Remote Scripting

How do I configure my ASP page to be called by remote scripting?

by  Swany  Posted    (Edited  )
Remember, the Java stub contacts the remote .ASP page so the .ASP page has to be configured to recieve requests from the STUB and process them accordingly.

This is done by adding the following lines to an ASP page you are going to call from remote scripting:

<%@ LANGUAGE=VBSCRIPT%>
<!--#INCLUDE FILE="/_ScriptLibrary/rs.asp"-->
<% [color #ff0000]RSDispatch [/color]%>

RSDispatch prepares the .ASP file for execution by remote scripting.

The next thing you need is a Description object. The Description object is a Javascript function that "exports" your functions to the remote scripting engine.
[color #ff0000]
<SCRIPT RUNAT=SERVER Language=javascript>
function Description()
{ [/color]

Inside the description object you need to define what procedures you are calling. If you are using Javascript in your ASP code all you have to do is:
[color #ff0000]this.myFunction = myFunction;
} //end of Description Function

//Function to be called by web page
function myFunction(param1, param2,...)
{
...
}
[/color]

You can define as many procedures and functions as you need. Simply create a [color #ff0000]this.functionname = functionname; [/color] for each function you want to export.

If you are using VBScript then you need a little extra work. Javascript supports a function object. You can use this function object to "trick" the Description object into working with VBScript.
[color #ff0000]
<SCRIPT RUNAT=SERVER Language=javascript>
function Description()
{
this.myFunction = Function('param1','param2','return myFunction(param1,param2)');

} //end of description object
</SCRIPT> <!-- end of javascript -->
<SCRIPT Language=VBScript>
'Function to be called from web page
function myFunction(param1, param2)
...
end function
</SCRIPT> <!-- end of vbscript -->
[/color]

Once you have your ASP page configured to accept remote scripting requests, you can begin to write your client side HTML code.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top