PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment.

<asp:DropDownList AutoPostBack=”true”
ID=”DropDownList1″ runat=”server”
onselectedindexchanged=
“DropDownList1_SelectedIndexChanged”>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>

You also add a MultiView control named MultiView1 to the Web page. MultiView1 has three child View controls.

You need to ensure that you can select the View controls by using the DropDownList1 DropDownList control.

Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
int idx = DropDownList1.SelectedIndex;MultiView1.ActiveViewIndex = idx;

B.
int idx = DropDownList1.SelectedIndex;MultiView1.Views[idx].Visible = true;

C.
int idx = int.Parse(DropDownList1.SelectedValue);MultiView1.ActiveViewIndex = idx;

D.
int idx = int.Parse(DropDownList1.SelectedValue);MultiView1.Views[idx].Visible = true;


Leave a Reply