Microsoft KB Archive/191565

= How To Create a Recursive Form Using Active Server Pages =

Article ID: 191565

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual Basic, Scripting Edition 2.0
 * Microsoft Active Server Pages 4.0

-



This article was previously published under Q191565



SUMMARY
This article explains one possible way to write Active Server Pages (ASP) code using VBScript to provide a recursive functionality within your ASP page.



MORE INFORMATION
Recursive means that the ASP page calls itself to continue with functionality. In the example below, the page posts form values to itself for processing. This is by no means necessary in all applications; it is merely provided as a more robust method to achieve functionality. One advantage to this method is fewer ASP pages to maintain. For example, a developer can make a self-contained "wizard" all in one ASP page.

This sample demonstrates the functionality with one post to itself.

Paste this code in a plain text document, and save it as "Recursive.asp." <%@ LANGUAGE="VBSCRIPT" %> <%     submitted = Request.Form("frmSubmit") %>    Recursive Example   <%  If submitted <> "yes" Then %>  Recursive Example " method="post" name="myForm">  Please enter some text:     <%   ElseIf submitted = "yes" Then %>  Form Has been submitted This is the information you submitted: <%=Request.Form("frmInput")%>  </HTML> <%  End If   %> WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS KB IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Microsoft provides examples of Visual Basic Script procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic Script procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular procedure, they will not modify these examples to provide added functionality, nor will they help you construct procedures to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom procedures. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.

Keywords: kbhowto KB191565

-

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

© Microsoft Corporation. All rights reserved.