Multiple choice .net asp

Changing an include file will affect all the pages that link to it such as a navigation bar. Suppose you want certain pages to display a certain navigation bar not available on other pages. Which is the BEST method to do this?

  1. Write a separate include file for those unique pages.

  2. Forget the include file. It is easier to just put the unique menu in using HTML code.

  3. Have the include file test for the type of page and then print out the correct menu.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Option C is the best approach because it maintains the single source of truth benefit of includes while handling variations intelligently. The include file can detect the current page type or context and dynamically output the appropriate navigation menu. Writing separate include files (Option A) creates maintenance overhead, while abandoning includes (Option B) defeats the purpose of code reuse and makes future changes more difficult.