Hi,
In my master page, I want to CHANGE MY HEADER IMAGE ACCODING TO THE CURRENT PAGE which the user is visiting. For each page I have each image. How can I change the header for each page in the master page? For example, I have an image for the registration(reg.aspx) page, I have another image for the products(prod.aspx) page, I have another image for the purchase (pur.aspx) page and so on.
Any clue!
Master Page-Changing Header matching for each page
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Dan16 reputationPosted Aug 22, 2008, 9:51 AM EDT
The MasterPage in .Net is really just another user control (basically) so you can do something like this:
1) Make a public method in your master page class called something like ChangeImage(string pageName). In this method you should have a switch or an if statement that examines the pageName and changes the image accordingly.
2) In each aspx page you can cast the page's master page to an instance of your master page class in the Page_Load event and call the method like this:
((MyMasterPage)this.Page.Master).ChangeImage("products");
Let me know if you need more help than that.
r pRank #4,639 · 333 reputationPosted Aug 28, 2008, 6:03 AM EDT
I am working on it now.
r pRank #4,639 · 333 reputationPosted Sep 29, 2008, 6:42 AM EDT
Thanks,