Sunit Katkar's Home Page

 Tutorials:



 ASP COM Links:
 

Steps for building our component: 4

Step 14: Here is the simple HTML code for using our MyForm component.
Create two HTML files for this.

First create a simple HTML file with a POST Form

         <html>
         <head><title> MyForm ASP COM demo - POST method</title>
         <BODY>
         <form name="PostForm" method="POST" action="FormPost.asp">
         First Name: <input type="text" name="txtField1" size="10" value="">
         Last  Name: <input type="text" name="txtField2" size="10" value="">
         <input type="submit" value="Submit">
         </form>
         </body>
         </html>
         

Next create a simple HTML file with a GET Form

         <html>
         <head><title> MyForm ASP COM demo - GET method</title>
         <body>
         <form name="PostForm" method="GET" action="FormGet.asp">
         First Name: <input type="text" name="txtField1" size="10" value="">
         Last  Name: <input type="text" name="txtField2" size="10" value="">
         <input type="submit" value="Submit">
         </FORM>
         </BODY>
         </HTML>
         

 

Step 15: Here is the ASP code for using our MyForm component.
Create two ASP files for this.

First create a ASP file FormPost.asp to process a POST Form

     
      <%@Language=VbScript%>
      <% Option Explicit %>
      <html>
      <head><title> MyForm ASP COM demo - POST method</title>
      <body>
      
      <%
      Dim objFormObject
      Set objFormObject = Server.CreateObject("MyForm.ProcessForm.1")
      objFormObject.FormPOST()
      %>
      </body>
      </html>
      

Next create a ASP file FormGet.asp to process a GET Form

      
      <%@Language=VbScript%>
      <% Option Explicit %>
      <html>
      <head><title> MyForm ASP COM demo - GET method</title>
      <body>
      
      <%
      Dim objFormObject
Set objFormObject = Server.CreateObject("MyForm.ProcessForm.1") objFormObject.FormGET() %>
</body> </html>

 

Download: You can download the VC++ project and the HTML and ASP files here. They are all zipped as one file. Once again, this code is for demonstration/tutorial purposes only. It is free for you to use in any way you seem fit, but please no flames or blame if it causes problems on your machine. I acknowledge all registered trademarks as being rightful property of their respective owners, etc.
Click here to download. Happy programming!

Note: We have not added any error checking code to this example. It is left upto you as an exercise.

Main |  1 |  2 |  3 |  4 |  5