[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Master and content

Posted on 2011-09-16
2
Medium Priority
?
379 Views
Last Modified: 2012-05-12
Hey Guys i have an master and content page, my menu is on the master page and the binding is done in the master page.

my problem is in the content page load i try finding the menu item and it is zero

so i need a event so fires after the master page loads.

here my content page load


protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Menu menu = (Menu)(this.Master.FindControl("Menu"));
            menu.FindItem("HOME").Selected = true;
        }
    }

Open in new window

0
Comment
Question by:JCWEBHOST
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
guramrit earned 2000 total points
ID: 36548447
try using PreRender as follows:
 
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        Menu menu = (Menu)(this.Master.FindControl("Menu"));
        menu.PreRender += menu_PreRender;
    }
}
void menu_PreRender(object sender, EventArgs e)
{
    var menu = (Menu)sender;
    menu.FindItem("HOME").Selected = true;
}

Open in new window

0
 

Author Closing Comment

by:JCWEBHOST
ID: 36548460
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question