This is the remote scripting file used by RSCombos and RSTreeView.htm. Note:that with the remote scripting samples there is a hard-coded path to the relevant support files, this will have to be changed appropriately for people to get the demos to work on their own system. These demo's only work with Internet Explorer 5.0. First Page--RSCombos.htm <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE>Two Combos using Remote Scripting</TITLE> </HEAD> <BODY> <!-- Author: Adrian Forbes --> <script language="JavaScript" src="../_scriptlibrary/rs.htm"></script> <script language="JavaScript">RSEnableRemoteScripting("../_scriptlibrary"); </script> <p> <select onChange="PopulateChildren()" name=cboParents ID=cboParent size=1> </select><select name=cboChildren ID=cboChildren size=1></select> </p>
<script language=VBScript> strDBPage = "RSDatabase.asp"
sub Window_onLoad PopulateParent PopulateChildren end sub
sub PopulateParent
set objParents = document.all("cboParents") set objRS = RSExecute(strDBPage ,"GetDBParents") sRS = objRS.return_value aRows = Split(sRS, Chr(13))
for i = 0 to UBound(aRows) - 1 aFields = Split(aRows(i), ";") set objOption = document.createElement ("OPTION") objOption.Value = aFields(0) objOption.Text = aFields(1) objParents.add objOption next end sub
sub PopulateChildren set objParents = document.all("cboParents") set objChildren = document.all("cboChildren") while objChildren.length > 0 objChildren.remove (0) wend set objRS = RSExecute(strDBPage ,"GetDBChildren", objParents.value) sRS = objRS.return_value aRows = Split(sRS, Chr(13))
for i = 0 to UBound(aRows) - 1 aFields = Split(aRows(i), ";") set objOption = document.createElement ("OPTION") objOption.Value = aFields(0) objOption.Text = aFields(1) objChildren.add objOption next end sub </script> </BODY> </HTML> Page 2 RSDatabase.asp <%@ LANGUAGE=VBSCRIPT %> <% strconn = "Driver={SQL Server};Description=sqldemo;SERVER=127.0.0.1; UID=LoginID;PWD=Password;DATABASE=Database_Name %> <% RSDispatch %> <!-- Author: Adrian Forbes --> <!--#INCLUDE FILE="../_ScriptLibrary/rs.asp"--> <SCRIPT RUNAT=SERVER Language=javascript> function Description() { this.GetDBParents = Function( 'return GetDBParents()' ); this.GetDBChildren = Function('ID', 'return GetDBChildren(ID)' ); this.Method1 = Method1; } public_description = new Description();
function Method1() { return 'Test'; } </script>
<SCRIPT RUNAT=SERVER Language=VBScript> function GetDBParents()
set objRS = createobject("ADODB.Recordset") objRS.Open "select ID, strParent from Parents", strconn GetDBParents = objRS.GetString(, , ";") objRS.Close set objRS.ActiveConnection = nothing set objRS = nothing end function
function GetDBChildren(ID)
set objRS = createobject("ADODB.Recordset") objRS.Open "select ID, strChild from Children WHERE intParent=" & ID, strconn GetDBChildren = objRS.GetString(, , ";") objRS.Close set objRS.ActiveConnection = nothing set objRS = nothing end function </SCRIPT>
|
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP Code Articles More By Adrian Forbes developerWorks - FREE Tools! | CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP. FREE! Go There Now!
| | | | Visit IBM developerWorks to download a free trial version of Lotus Quickr 8.0, which enables collaboration by transforming the way everyday business content such as documents, rich media, photos, and video can be shared. Lotus Quickr makes it faster and easier to share content of all types (not just documents) within virtual teams. It is designed to make it easier to collaborate across organizational boundaries, while continuing to work within the context of familiar desktop applications. FREE! Go There Now!
| | | | Visit IBM developerWorks to download a free trial version of WebSphere Extended Deployment Compute Grid, which lets you schedule, execute, and monitor batch jobs. Because online transaction processing and batch jobs execute simultaneously on the same server resources, you can avoid costly duplication of resources. Compute Grid supports job types of Java transactional batch, compute-intensive and a new type called "native execution", which enables non-Java workloads to run on distributed end points. FREE! Go There Now!
| | | | Join us for this web seminar to learn how you can defend your web applications from attack. Learn about the 3 most common web application attacks, including how they occur and what can be done to prevent them. We’ll also discuss manual versus automated approaches for scanning and identifying web application vulnerabilities and how IBM Rational AppScan, an automated vulnerability scanner, can help you automate more of what you are doing manually today. FREE! Go There Now!
| | | | Portfolio Management is about effectively managing portfolio value by aligning portfolio investments with business goals. This complimentary e-kit provides a collection of materials that can help you understand how IBM Rational enables and automates best practices for improved governance and clear visibility into portfolio and project performance across the entire IT project lifecycle. FREE! Go There Now!
| | | | This whitepaper provides areas to consider when evaluating any software configuration management solution. It addresses how the IBM solutions (Rational ClearCase and Rational ClearQuest) meet the needs and requirements of both project leaders and developers to provide successful Software Change and Configuration Management. FREE! Go There Now!
| | | | Regression testing -- in which code is thoroughly tested to ensure that changes have not produced unexpected results -- is an important part of any development process. But many testing environments neglect the terminal-based applications that still form the backbone of many industries. In this tutorial, you'll learn how the Rational Functional Tester Extension for Terminal-Based Applications works with other Rational Functional Tester to help test terminal-based applications quickly and easily. FREE! Go There Now!
| | | | Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly. FREE! Go There Now!
| | | | Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
| | | | Join the IBM Watchfire team for an informative discussion on techniques and best practices to proactively manage Web application security and how to effectively build application security testing into the software development lifecycle (SDLC). In this Software Delivery Platform webcast you will learn: How to better understand potential web application security vulnerabilities, best practices and how to effectively integrate application security testing into the software development lifecycle, the importance of detecting and removing software vulnerabilities during application development. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |