Return To Home Page - Link to "The Wanker" - Contact Us


Return To Home Page

Using Forms to send information between ASP Pages



Many beginner ASP programmers have a hard time with this concept. Here is an example if you want to use forms to transfer information between ASP pages. It is actually very simple and is used quite often when building ASP applications.

Using a Form With Post

<form action="somepage.asp" method=POST>
   <input type ="text"
value ="somevalue" name ="somevariable">
   <input type=submit>
</form>


Supports more characters than GET or PUT
The page the form is submitted to will not show the parameters in the address window

The ASP page the form is submitted to uses the following code to retrieve the variable

<% somevariable = Request.Form("somevariable") %>


Using a Form with GET or PUT


<form action="somepage.asp" method=GET>
   <input type ="text" value ="somevalue" name ="somevariable">
   <input type=submit><input type=reset>
</form>


The number of characters is limited
The page the form is submitted to will show the parameters in the address window
The ASP page the form is submitted to uses the following code to retrieve the variable

<% somevariable = Request.Querystring("somevariable") %>


Something To Think About
You can simply use Request("somevariable")
and it will retrieve it from the header no matter which of the 3 methods you used. This is probably a little slower but it makes for easier coding if you are not worried about milliseconds of time savings.

Also some versions of IE on the MAC do not work with "PUT" and will give you a 404 error, so it is probably best just to use "GET" though it is definitely a bug that they never seem to fix.


Banner
ASP (Active Server Pages) is a technology developed by Microsoft. Pages using ASP are primarily developed in JScript, or VBScript and are integrated into the HTML of your Web pages. The ASP code is compiled on-the-fly by the server and the resulting output is standard HTML. By using ASP, Web pages can be dynamic, full of ever-changing content, and browser independent.
vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com,www.abay.com

 

Link to "The Wanker"
© 2007 CodeWanker - Active Server Pages Articles, Code Snippets, & Tutorials