PrepAway - Latest Free Exam Questions & Answers

You need to ensure that the menu items are populated from an array of strings in your code-behind file

You create a Web page that has an ASP.NET menu. You need to ensure that the menu items are
populated from an array of strings in your code-behind file. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Write a JavaScript function that uses document.write to write out an asp:MenuItem for each
string array element.

B.
In the Page_Render handler, use Response.Write to write out an asp:MenuItem for each string
array element.

C.
Set the DataSource attribute of asp:Menu to the name of the array.

D.
In the Page_Load handler, create an instance of asp:MenuItem for each string array element, and
add each of these instances to the menu’s Items collection.


Leave a Reply