---
title: Creating the main menu (ASPX)
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Now add a dynamic drop-down menu to the master page. You can implement the drop-down menu using either the **CMSMenu** or **CMSListMenu** control. The example uses the first option, which is easier to understand if you are not familiar with advanced CSS styles.

> **Info:** If you prefer a drop-down menu based on CSS styles and UL/LI elements, you can try using the CMSListMenu later. See the [Controls Reference](https://docs.kentico.com/k82/references/kentico-controls/cms-controls/cms-controls-navigation/cmslistmenu.md) for additional details and examples.

1. Edit the **MyMaster.master** file in Visual Studio.
2. Remove the **** element used as a static menu inside the **** element. Instead, drag the **CMSMenu** control from the toolbox to this location.
3. Set the following properties of the **CMSMenu** control (you can find them in the **Behavior** section of the Visual Studio **Properties** window):

   | Property  | Value      | Description                                                                                                                                                                                                                      |
   | --------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Path      | /%         | Configures the menu to display pages starting from the root of the site structure.                                                                                                                                               |
   | Layout    | Horizontal | Sets a horizontal layout for the menu.                                                                                                                                                                                           |
   | CSSPrefix | ;sub       | Allows you to add prefixes before the names of the CSS classes applied to the menu. The ;sub value uses unmodified class names for the main (first) menu level and the sub prefix for the second level and all other sub-levels. |
   | Cursor    | Pointer    | Specifies the type of mouse cursor displayed when a user hovers over the menu.                                                                                                                                                   |
4. Save the changes.

The code of the main menu section should now look like this:

```html

<!-- main menu -->
<div class="MainMenu">
    <cms:CMSMenu ID="CMSMenu1" runat="server" Path="/%" Layout="Horizontal" CSSPrefix=";sub" Cursor="Pointer" />
</div>

```

The master page is now prepared and you can assign it to the site's ASPX templates. Continue with [Developing the Home page (ASPX)](https://docs.kentico.com/k82tutorial/walkthrough-creating-a-new-site-using-aspx-templates/developing-the-home-page-aspx.md)

> **Info:** **Kentico Controls and Web Parts**
>
> Kentico provides a set of flexible server controls in the **CMS.Controls.dll** library, but large amounts of the built-in functionality are only available through web parts stored in the **CMSWebParts** folder.
>
> These web parts are standard ASCX user controls and you can use them on both portal engine templates and ASPX pages. To add a web part onto your ASPX pages, drag it from the Solution explorer and set the properties in the Properties window.
