ASP
  Home arrow ASP arrow Page 2 - Remote Scripting With JavaScript and ASP
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

Remote Scripting With JavaScript and ASP
By: Annette Tennison
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 26
    2002-12-14

    Table of Contents:
  • Remote Scripting With JavaScript and ASP
  • What is remote scripting?
  • Testing remote scripting
  • Enabling remote scripting on the server side
  • Another remote scripting example
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Remote Scripting With JavaScript and ASP - What is remote scripting?


    (Page 2 of 6 )

    Remote scripting is a technology that allows us to call server side ASP script from the client using JavaScript. The main benefits of using remote scripting are that it's cross browser compatible (works on NS4.x+ and IE4.x+) and takes away the need to refresh a page when some sort of server action is required to either send/receive data.

    The way in which remote scripting works is fairly trivial, and only requires a small amount of tinkering to get it up and running properly. Firstly, you must configure remote scripting on both the client and server (which we will look at next). Once it's configured, you create an ASP page containing all of the functions that you’d like to expose to the client and call them in a special way.

    These functions are created is the same way that you would create any ASP functions (with the function myFunc()... end function syntax), however some server side JavaScript is also included with the ASP script allowing the client to view your entire ASP page as an object that exposes methods. The remote scripting engine handles all of this under the hood, so we don't need to go into detail about it here.

    Installing remote scripting

    The technology behind remote scripting is not extremely complicated, and to enable remote scripting capabilities on our IIS web server we only need a handful of files: rs.htm, rsproxy.class and rs.asp. These files are available for download as "Remote Scripting 1.0b" here, and you should download them before continuing.

    When you run the setup program it will prompt you for an installation directory, which is C:\inetpub\wwwroot\_ScriptLibrary by default. When remote scripting is taking place, it assumes that it can find several files in the _ScriptLibrary folder on your IIS web server, so it's a good idea to change the c:\inetpub\wwwroot part of the installation path to match your default web directory. For example, if you currently store all of your files in c:\myweb and you’ve configured IIS to look in the c:\myweb folder when a HTTP request is received, then you should change the remote scripting installation path to c:\myweb\_ScriptLibrary.

    Once you've installed remote scripting, you should see the following files and folders in the _ScriptLibrary folder under your IIS web folder:
    • rs.htm: Contains the plumbing and functions that make remote scripting on the client side possible. Most notably, rs.htm contains three public methods called RSEnableRemoteScripting, RSExecute and RSGetASPObject. Rs.htm is implemented in JavaScript.
    • rs.asp: Contains the plumbing and functions that make remote scripting on the server side possible. Its main method is RSDispatch, which handles all marshalling and the returning of data back to the client.
    • rsproxy.class: A Java class that is dynamically added to the clients HTML output when rs.htm is called. It handles some of the internals that are required by the remote scripting engine to function correctly including the communication between the client and server scripts.
    • /docs: Documentation detailing how to setup remote scripting, how to implement remote scripting into client and server code, etc.
    • /samples: Contains a sample that implements remote scripting.

    More ASP Articles
    More By Annette Tennison


     

    ASP ARTICLES

    - Central Scoreboard with Flash and ASP
    - Calorie Counter Using WAP and ASP
    - Creating PGP-Encrypted E-Mails Using ASP
    - Be My Guest in ASP
    - Session Replacement in ASP
    - Securing ASP Data Access Credentials Using t...
    - The Not So Ordinary Address Book
    - Adding and Displaying Data Easily via ASP an...
    - Sending Email From a Form in ASP
    - Adding Member Services in ASP
    - Removing Unconfirmed Members
    - Trapping HTTP 500.100 - Internal Server Error
    - So Many Rows, So Little Time! - Case Study
    - XDO: An XML Engine Class for Classic ASP
    - Credit Card Fraud Prevention Using ASP and C...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway