Ejemplo n.º 1
0
        private void LoadMenu()
        {
            string menu = " <ul>";
            EGEMech.BLL.Page page = new EGEMech.BLL.Page();
            page.GetAllPagesByParent(0);
            for (int i = 0; i < page.RowCount; i++)
            {
                menu += "<li><a href='Default.aspx'>" + page.Title + "</a> ";
                menu += LoadChildren(page.PageID);
                menu += "</li>";
                page.MoveNext();
            }
            menu += "</ul>";

            Literal1.Text = menu;
        }
Ejemplo n.º 2
0
 private string LoadChildren(int parent)
 {
     string submenu = "";
     EGEMech.BLL.Page page = new EGEMech.BLL.Page();
     page.GetAllPagesByParent(parent);
     if (page.RowCount > 0)
     {
         submenu = "<ul style='display: none;'>";
         for (int i = 0; i < page.RowCount; i++)
         {
             submenu += "<li><a href='Default.aspx'>" + page.Title + "</a> ";
             submenu += LoadChildren(page.PageID);
             submenu += "</li>";
             page.MoveNext();
         }
         submenu += "</ul>";
     }
     return submenu;
 }