If it is always equal to the URL, the easiest way would be to use it using the following:
var menuitems = Request.Url.AbsolutePath.Split("/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
menuitems will now contain the menu items needed to complete a simple foreach loop and create your menu.
source share