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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business