Ejemplo n.º 1
0
 protected void AdminPage_BeforeHeaderControlsAdded(object sender, EventArgs e)
 {
     // Add the admin menu to the page. Note that if you use any index other than 0 in the AddAt method, the viewstate
     // is not preserved across postbacks. This is the reason why the <see cref="BeforeHeaderControlsAdded"/> event was created in
     // <see cref="GalleryPage"/> and handled here. We need to add the admin menu *before* <see cref="GalleryPage"/> adds the album breadcrumb
     // menu and the gallery header.
     Controls.Admin.adminmenu adminMenu = (Controls.Admin.adminmenu)LoadControl(Utils.GetUrl("/controls/admin/adminmenu.ascx"));
     this._adminMenu = adminMenu;
     this.Controls.AddAt(0, adminMenu);
     //this.Controls.AddAt(Controls.IndexOf(AlbumMenu) + 1, adminMenu); // Do not use: viewstate is not preserved
 }
Ejemplo n.º 2
0
 protected void AdminPage_BeforeHeaderControlsAdded(object sender, EventArgs e)
 {
     // Add the admin menu to the page. Note that if you use any index other than 0 in the AddAt method, the viewstate
     // is not preserved across postbacks. This is the reason why the <see cref="BeforeHeaderControlsAdded"/> event was created in
     // <see cref="GalleryPage"/> and handled here. We need to add the admin menu *before* <see cref="GalleryPage"/> adds the album breadcrumb
     // menu and the gallery header.
     Controls.Admin.adminmenu adminMenu = (Controls.Admin.adminmenu)LoadControl(Utils.GetUrl("/controls/admin/adminmenu.ascx"));
     this._adminMenu = adminMenu;
     this.Controls.AddAt(0, adminMenu);
     //this.Controls.AddAt(Controls.IndexOf(AlbumMenu) + 1, adminMenu); // Do not use: viewstate is not preserved
 }