Page.Check Method

The Check method generates the word CHECKED into a page if the value specified in the Value parameter is a nonzero value. CHECKED is a parameter to an HTML <INPUT> tag, which sets a check box or radio button to selected when the form first loads.

Syntax

Page.Check(Value)

Parameters

Value
An expression that is evaluated to determine whether the word CHECKED should be inserted at the place in a page where the call to Check appears.

Example

The following example could be used in an ASP file to generate three radio buttons in an HTML form:

<% my_color="Green" %>
<INPUT TYPE="RADIO" NAME="CONTROL1" VALUE="0"<% = mscsPage.Check(my_color="Red")%>>Red
<INPUT TYPE="RADIO" NAME="CONTROL1" VALUE="1"<% = mscsPage.Check(my_color="Green")%>>Green
<INPUT TYPE="RADIO" NAME="CONTROL1" VALUE="2"<% = mscsPage.Check(my_color="Blue")%>>Blue

Assuming that my_color contains "Green" this produces the following HTML output:

<INPUT TYPE="RADIO" NAME="CONTROL1" VALUE="0">Red
<INPUT TYPE="RADIO" NAME="CONTROL1" VALUE="1"CHECKED>Green
<INPUT TYPE="RADIO" NAME="CONTROL1" VALUE="2">Blue

This HTML output produces three radio buttons labeled Red, Green, and Blue, with the Green option selected.

Related Topics


© 1997-1998 Microsoft Corporation. All rights reserved.