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.
Dim idx As Integer = DropDownList1.SelectedIndex
MultiView1.ActiveViewIndex = idx

B.
Dim idx As Integer = DropDownList1.SelectedIndex
MultiView1.Views(idx).Visible = True

C.
Dim idx As Integer = Integer.Parse(DropDownList1.SelectedValue)
MultiView1.ActiveViewIndex = idx

D.
Dim idx As Integer = Integer.Parse(DropDownList1.SelectedValue)
MultiView1.Views(idx).Visible = True

Explanation:
ActiveViewIndex is Zero base Index.


Leave a Reply