spacer
Yehuda Shiran October 18, 2002
Using the Global Server Object
Tips: October 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Response, Server, Session, and Application.

The Server object includes one property and four methods. The property is ScriptTimeOut. It lets you control when the script processing should time out. The four methods are:

  • CreateObject: creates an instance of a server component. You must have this component installed on your server.
  • HtmlEncode: encodes a string in HTML.
  • MapPath: maps the current virtual directory to a given physical directory.
  • URLEncoding: URL-encodes a given string

In IBuySpy, we convert the user name to HTML with Server.HtmlEncode and then save the HTML stream in a cookie, for personalizing the next "Welcome Back" message:

  Response.Cookies["IBuySpy_FullName"].Value = Server.HtmlEncode(Name.Text);

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 >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint