SunQuest
 
       ASP Code
  Home arrow ASP Code arrow Page 3 - ASP Forms
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP CODE

ASP Forms
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2007-11-21

    Table of Contents:
  • ASP Forms
  • Cookies
  • A Baker's Dozen
  • Sessions
  • How to Store Sessions and Retrieve Them

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    ASP Forms - A Baker's Dozen


    (Page 3 of 5 )

    Bakers must be dumb. I mean don't get me wrong: I love the incredible and all important work they do. But don't they know that a dozen is only equal to twelve and not thirteen? But who cares, we get that extra donut free of charge. So stick it to the baker. And shh...don't let them know.

    If you want to store more than one piece of data in a cookie, you can. I won't stop you. When you do so, it is called a collection and the values inside are referred to as keys.

    Here is how we create a cookie named "fortune" with multiple values:


    <%

    Response.Cookies("fortune") ("fortuneone") = "You will die a horrible death. Have a good day"

    Response.Cookies("fortune") ("fortunetwo") = "You will meet a handsome stranger. Then he will rob you"

    Response.Cookies("fortune") ("fortunethree") = "Life is like a box of vacuum cleaners. It sucks."

    %>

    Reading the Collection

    Here, we learn to read the keys in our Cookie collection:


    <html>

    <body>

    <%

    Dim x, y

    for each x in Request.Cookies

    response.write("<p>")

    If Request.Cookies(x).HasKeys then

    for each y in Request.Cookies(x)

    response.write(x & "/" & y & "=" & Request.Cookies(x) (y))

    response.write("<br />")

    next

    else

    Response.Write(x & "=" & Request.Cookies(x) & "<br />"

    end if

    response.write "</p>"

    next

    %>

    </body>

    </html>

    How is that for some wacky code. Here is the result:

      fortune/fortuneone=You will die a horrible death. Have a good day

      fortune/fortunetwo=You will meet a handsome stranger. Then he will rob you

      fortune/fortunethree=Life is like a box of vacuum cleaners. It sucks.

    More ASP Code Articles
    More By James Payne


       · how to data update,search,save in database through forms button
     

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway