PrepAway - Latest Free Exam Questions & Answers

What should you do next?

You are developing a product search page named Search.aspx for Web application that will be integrated into Domain.com’s existing e-Commerce Web site. The Search.aspx page allows customers search for products that match specific criteria. The search criteria are implemented as CheckBox controls. The Search button is implemented as a Button control. You want the CheckBox controls to be cleared when the Search button is clicked. You set the Checked property of each CheckBox to False in the designer.
What should you do next?

PrepAway - Latest Free Exam Questions & Answers

A.
Set the EnableViewState property of each CheckBox to False in the designer.

B.
Set the Checked property of each CheckBox to False in the Page_Load event handler if the Search.aspx page’s IsPostBack property is True.

C.
Set the AutoPostBack property of each CheckBox to False in the designer.

D.
Set the Checked property of each CheckBox to False in the event handler for the Search button’s Click event.

Explanation:
To ensure that the initial state of the CheckBox controls are clear, you must set the Checked property of each CheckBox to False in the designer. You should then set the Checked property of each CheckBox to False in the event handler for the Search button’s Click event to reset the CheckBox controls to their initial state upon the Click event.

Incorrect Answers:
A: Setting the EnableViewState property will not clear the CheckBox controls. The EnableViewState property determines whether the CheckBox controls should be visible or not.
B: Setting the Checked property of each CheckBox to False in the Page_Load event handler if the Search.aspx page’s IsPostBack property is True will clear the CheckBox controls whenever a postback occurs. You want the CheckBox controls to be cleared when the Search Button is clicked, not when a postback occurs.
C: The AutoPostBack property will clear the CheckBox controls whenever a postback occurs. You want the CheckBox controls to be cleared when the Search Button is clicked, not when a postback occurs.


Leave a Reply