Long island web design, hosting company
Home About Us Support Products Services Portfolio Contact Us Home

ASP > Dictionary Object

Created On: 11/24/2004 10:06:00 AM

Dictionary object is an useful object to store any form of data in an array list. Following asp script block stores all data coming from a form and list them in our HTML codes.
<html>
<head>
<title>
Sample Code</title>
</head>
<body>

<%
if request.form("func") = "SEND" then
Dim strVar
Set strVar = CreateObject("Scripting.Dictionary")
strVar.Add "name", request.form("name")
strVar.Add "lastname", request.form("lastname")
strVar.Add "email", request.form("email")
' Now we are displaying an item in our dictionary
response.write strVar("name")
end if
%>

<form method=
"POST" action="default.asp">
<table border="0" cellspacing="0" cellpadding="0" width="500">
<tr>
<td width="163">Name :</td>
<td width="333"><input type="text" name="name" size="20"></td>
</tr>
<tr>
<td width="163">Last Name :</td>
<td width="333"><input type="text" name="lastname" size="25"></td>
</tr>
<tr>
<td width="163">Email :</td>
<td width="333"><input type="text" name="email" size="30"></td>
</tr>
</table>
<p><input type="submit" value="SEND" name="func"></p>
</form>
</body>
</html>