
254
|
Chapter 12: The Page Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
In the example, the EnableClientScript property of the RequiredFieldValidator
control is set to
False, which disables client-side validation. By default, client-side
validation is enabled and the page is never submitted to the server if the valida-
tion fails. Uplevel browsers perform validation on the client using client-side
scripts, and only when validation succeeds is the page submitted. Only when the
page is submitted is the server-side event handler code executed and the message
displayed based on the value of the IsValid property.
Checking the IsValid property is important whether client-side validation is
enabled, since a malicious client could bypass client-side validation
Request
HttpRequest = Page.Request
Returns an instance of the HttpRequest class that allows us to access data from the
incoming HTTP requests. It’s the equivalent of the ASP intrinsic Request object.
For more information on the
HttpRequest class, see Chapter 16.
Parameter
HttpRequest
An object of type HttpRequest that contains the data from the incoming
HTTP requests.
Example
The following code example uses the ServerVariables collection of the HttpRe-
quest object to display the IP address of the client making the request:
Sub Page_Load( )
Message.Text = "The current request is from: ...