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!
Loading
DanPosted Aug 22, 2008, 1:51 PM
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 pPosted Sep 29, 2008, 10:42 AM
Thanks,
r pPosted Aug 28, 2008, 10:03 AM
I am working on it now.