954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Change the table background in the master page from the content page

So I have a menu on the master page that is in a table, and I want to change the background of the cell that the clicked link is in depending on the page the user is on.

I tried adding this function on the master page

public void HomePage()
        {
            HOMEPAGE.Style.Add(HtmlTextWriterStyle.BackgroundColor, "Red");       
        }


and then simply calling this function in the Page_Load of the content page but it didn't work.

Should I call this function in a different method like Init or PreInit, or am I using a wrong approach altogether?

GregoryHouseMD
Newbie Poster
10 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

write code behind the master page and find which menu was selected...depending upon selection change background of table..also write table id for find this table id in codebehind

crishlay
Junior Poster
132 posts since May 2010
Reputation Points: 10
Solved Threads: 16
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: