Performing Page Navigation (Scenario 1) (Cont.)
The following list gives comments about the previous examples:
- The web server control <
asp:hyperlink runat="server"
> is used to create a hyperlink.
- The class
Random
represents a pseudo-random number generator.
- The
random(Int32)
constructor initializes a new instance of the Random
class, using the specified seed value.
- The method
Next(Int32)
returns a random number from 0 to maxValue
-1.
- The method
Server.HtmlEncode
encodes a URL string.
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end.
URL encoding converts characters that are not allowed in a URL into character-entity equivalents.
For example, the characters < and > are encoded as %3c and %3e.
- The class
Page
includes the following properties:
IsValid
which gets a value indicating whether page validation succeeded.
Page.IsPostBack
which gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
- The object
Server
can be used to access methods and properties on the server.
Most of these methods and properties serve as utility functions.
The method Server.HtmlDecode
decodes a string that has been encoded to eliminate invalid HTML characters.