spacer
Yehuda Shiran October 16, 2002
Using the Global Request Object
Tips: October 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

ASP.NET inherited the built-in objects from ASP. These objects are global in the sense that you don't need to construct them or pass them around; they are always there. There are five built-in objects:

  • Request: Passes information from the user
  • Response: Passes information to the user
  • Server: Controls the IIS Web server
  • Session: Stores and changes information about the user's current Web server session
  • Application:Stores information about the current application. Persistent during the lifetime of the application

The Request and Response objects include collections as their properties. These are the Request object's collections:

  • ClientCertificate: the certificate field issued by the browser. The field names are specified in the x.509 standard
  • QueryString: a free text field
  • Form: the data in an HTML form
  • Cookies: the value of an application-defined cookie
  • ServerVariables: information about the server, such as the server name

IBuySpy uses the Cookies collection above. When the initial default page (Default.aspx) loads, we check if there is a personalization cookie around, and assemble a personalized Welcome message if there is such a cookie. This is the role of Page_Load():

  function Page_Load(sender: Object , e: EventArgs) : void {
    if (Request.Cookies["IBuySpy_FullName"] != null) {
      WelcomeMsg.Text = "Welcome " + Request.Cookies["IBuySpy_FullName"].Value;
    }
  }

People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji