Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

ASP Tutorial
ASP Introduction
Run An ASP Web Page
ASP First Script
ASP Programming-VBScript
Variables in ASP
Array in ASP
Operators in ASP
ASP If Statements
ASP Select Statements
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
Application in ASP
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP Ad Rotator
ASP Browser Cap
ASP Content Linking
ASP Content Rotator
ASP Quick Reference
ASP Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Forms in ASP
Previous Next

  • Using ASP you can process information gathered by an HTML form and use ASP code to make decisions based off this information to create dynamic web pages



  • To retrieve information from forms, like user input the Request.QueryString and Request.Form commands may be used



  • An ecommerce site could take the user's information and store it into a database named user.



  • This information could then be used to prepopulate the shipping information when the user is ordering another product



  • By taking the title and body a forum might save the user's post to a forum and saving it to a file so that it can then be called later when someone wants to view it




Create an HTML Form

  • You need to create an HTML form that will send information to your ASP page,before processing the information.

  • For sending data to an ASP form there are two methods named GET and POST.

  • In your HTML Form element's Method attribute,these two types of sending information are defined . Also, the location of the ASP web page must be specified that will process the information

  • Below is a simple form that will send the data using the GET method. Copy and paste this code and save it as as "vyomForm.html".

vyomForm.html Code:
<form method="GET" action="vyomFormProcess.asp">
Name <input type="text" name="Name"/>
Age <input type="text" name="Age"/>
<input type="submit" value="Submit Query" />
</form>
O/P:

Name: Age:



Form Example in ASP Using Method="get"
<html>
<body>
<form action="demo_reqquery.asp" method="get">
Your name: <input type="text" name="fname" size="20" />
<input type="submit" value="Submit" />
</form>
<%
dim fname
fname=Request.QueryString("fname")
If fname<>"" Then
Response.Write("Hello " & fname & "!<br />")
Response.Write("How are you today?")
End If
%>
</body>
</html>
O/P:

Your Name:

Results:

Hello Vyom!
How are you today?



Request.QueryString

  • To collect values in a form with method="get",the Request.QueryString command is used .

  • Information sent from a form with the GET method has limits on the amount of information to send and is visible to everyone (it will be displayed in the browser's address bar) .

  • In the form example above,if a user typed "Martin" and "Luther" , the URL sent to the server would look like this:

http://www.academictutorial.com/FormProcess.asp?fname=Martin&lname=Luther
ASP Code Using Request.QueryString:
<body>
Welcome
<%
response.write(request.querystring("fname"))
response.write(" " & request.querystring("lname"))
%>
</body>

In the body of the document,the browser will display the following :

Welcome Martin Luther



Request.Form

  • To collect values in a form with method="post",the Request.Form command is used.

  • Information sent from a form with the POST method has no limits on the amount of information to send and is invisible to others .

  • In the form example above,if a user typed "Martin" and "Luther" , the URL sent to the server would look like this:

http://www.academictutorials.com/FormProcess.asp
ASP Code Using Request.Form:
<body>
Welcome
<%
response.write(request.form("fname"))
response.write(" " & request.form("lname"))
%>
</body>

In the body of the document, the browser will display the following :

Welcome Martin Luther



Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords: asp forms user, asp forms runat, asp forms attribute, microsoft corporation


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.