
UrlDecode | 397
ServerUtility
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Notes
The ability to clear the Form and QueryString collections prior to passing control
to the page that the
Path argument specifies is new in ASP.NET. This is conve-
nient for passing control to pages that you did not create and that might break if
they encounter unexpected values, or if you want to keep the Form or
QueryString contents private. If you do not pass a
preserveForm argument, the
default behavior is for the Form and QueryString collections to be preserved.
Make sure that no code in your page must execute after a Server.Transfer. If you
have such code, you may want to consider using Server.Execute instead.
UrlDecode
returnstring = Server.UrlDecode(s)
Server.UrlDecode(s,output)
Returns a string in which any special character sequences resulting from encoding
by the UrlEncode method (described later in this chapter) are decoded back into
the original format. For example, a URL with a query string such as:
http://localhost/ASPdotNET_iaN/Chapter_18/UrlDecode.
aspx?strtodecode=This%20is%20a%20good%20string.
would return the following string from the UrlDecode method:
This is a good string.
Parameters
returnstring
A string variable to receive the decoded string from the method.
s
A string variable containing the encoded URL to be decoded by the method. ...