The following example demonstrates how to use the HtmlEncode method and the UrlEncode method of the HttpServerUtility class. The HtmlEncode method helps ensure that any user-supplied string input will be rendered as static text in browsers instead of executable script or HTML elements. The UrlEncode method encodes URLs so that they are correctly transmitted in the HTTP stream.