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.
Page.Check(Value)
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.