This is a migrated thread and some comments may be shown as answers.

Dynamic Menu Creation - loses menu in MasterPage

4 Answers 62 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 03 Nov 2008, 06:30 PM
Hi..
I have a Menu in a MasterPage.
On the page Load of the menu I create an additional menu option. As soon as you navigate to another page the 'custom' dynamic option goes away. Any ideas?
thanks!

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

if (Session["OFFICECODE"] == null)

 

{

Session[

"OFFICECODE"] = SecurityManager.GetOfficeCode(HttpContext.Current.User.Identity.Name);

 

Session[

"Office_Table"] = SecurityManager.GetOfficeCodeData(Session["OFFICECODE"].ToString());

 

 

 

if (((Admin.OfficeCodeDataTable)Session["Office_Table"]).Rows.Count != 0)

 

{

 

RadMenuItem NewItem = new RadMenuItem();

 

NewItem.ForeColor = System.Drawing.

Color.Blue;

 

NewItem.Text = ((

Admin.OfficeCodeDataTable)Session["Office_Table"])[0].SenatorElect;

 

NewItem.ToolTip = NewItem.Text;

NewItem.Width = 375;

 

this.RadMenu.Items.Add(NewItem);

 

}

}

// end if

 

 

}

4 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 04 Nov 2008, 09:28 AM
Hello Jon Elster,

Does the page that you are redirected to uses the same MasterPage?

Kind regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 04 Nov 2008, 12:49 PM
Yes... !
0
Jon
Top achievements
Rank 1
answered on 04 Nov 2008, 08:47 PM
Help... any ideas?
thanks
0
Veselin Vasilev
Telerik team
answered on 07 Nov 2008, 11:41 AM
Hello Jon Elster,

I have created a sample project, but could not reproduce the problem. Maybe your scenario is a bit different. Please download my test pages and let me know how to reproduce the problem.

Thanks

Greetings,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Jon
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Jon
Top achievements
Rank 1
Share this question
or