Click here to Skip to main content
16,017,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to add more item in a Menu control in the master page from the child page.
I have write the following code on the button click event on the child page:
VB
Dim menu1 As New Menu
            Dim menuitem1, menuitem2 As New MenuItem
            menu1 = Master.FindControl("Menu1")
            menuitem1.Text = "product"
            menuitem2.Text = "services"
            menuitem1.NavigateUrl = "home.aspx"
            menuitem2.NavigateUrl = "logout.aspx"
            menu1.Items.Add(menuitem1)
            menu1.Items.Add(menuitem2)
            menu1.DataBind()

However this code make no changes to the master page .please help me
Posted
Updated 16-Mar-10 21:38pm
v2

1 solution

The way to access the Master control in Child page looks ok.

After executing the PageLoad of child page, the execution will go into the PageLoad of Master page. have you considered this? is the menu control reformed and bind in the PageLoad of Master page?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900