Professional Documents
Culture Documents
TextBoxes
RadioButtons
CheckBox
DropDownList
RadioButtonList
CheckBoxList
ListBox
Button
Image
Hyperlink
ID="ddlState"
ID="rblAge"
ID="cblAreas"
ID="ddlCategory"
ID="CategoryLabel"
ID="lbSubcategory"
ID="cbDisplayPhoto"
to set ReadOnly="true"
the summary.
Write an event handler to handle the CheckChanged event of the last checkbox to
control the display of the image or not.
On toggling the checkbox cbDisplayPhoto to display or hide the photo, the
scroll position of the page should be maintained on postback.
Modify the listbox lbSubcategory to allow multiple select. Handle the display
of the content of the chosen items in this listbox properly.
BSc in Computing
COMP222 Internet Programming I
Lab Practice 2 Part 2 ~ Suggested Answers
3. On toggling the checkbox cbDisplayPhoto to display or hide the photo, the
scroll position of the page should be maintained on postback.
At Page directive (Go to the Source page of the aspx page, line 1),
set MaintainScrollPositionOnPostback="True"
4.
Modify the listbox lbSubcategory to allow multiple select. Handle the display
of the content of the chosen items in this listbox properly
4.1 For aspx page:
First, set SelectionMode=Multiple for the listbox lbSubcategory
Set TextMode="MultiLine" for the Textbox (ID="SubCategoryTextBox") to
display the content of the chosen Subcategory
4.2 For aspx.vb code-behind file, comment out the line
SubCategoryTextBox.Text = lbSubcategory.SelectedValue
Dim Subcategory As String = String.Empty
this is necessary to prevent run-time error
when no choices have been made from lbSubcategory
Dim li As ListItem
For Each li In lbSubcategory.Items
If li.Selected Then
Subcategory += li.Text + vbLf
End If
Next
SubCategoryTextBox.Text = Subcategory