Changing a Master Sheet control when navigating between content pages

S

Stratum

It's an old question, and I apologize for raising it again.

I use ImageButton objects on my ASP.Net master page to navigate to
content pages. For each button, I have two images.
One image shows black print on a white background, and
the other image shows the same printing in white
on a red background to indicate the content page
which is presently loaded.

When I navigate between pages, I want the
images on the new content page and the old
content page to change. If I use a
button_click event handler in the master
page code-behind (C#), this effect unfortunately
does *not* occur. Apparently, the new content
page is being loaded before the button images
change, and the newly loaded page doesn't
know this.

Anyone know the solution? Seems I've had this
problem before and figured out the fix, but I
no longer have access to the source.
 
M

Masudur

It's an old question, and I apologize for raising it again.

I use ImageButton objects on my ASP.Net master page to navigate to
content pages. For each button, I have two images.
One image shows black print on a white background, and
the other image shows the same printing in white
on a red background to indicate the content page
which is presently loaded.

When I navigate between pages, I want the
images on the new content page and the old
content page to change. If I use a
button_click event handler in the master
page code-behind (C#), this effect unfortunately
does *not* occur. Apparently, the new content
page is being loaded before the button images
change, and the newly loaded page doesn't
know this.

Anyone know the solution? Seems I've had this
problem before and figured out the fix, but I
no longer have access to the source.


hi...

check out this post
http://groups.google.com/group/micr...rol+from+content+page&rnum=3#bfd7eda8c42d10f0

Thanks
Masudur
http://munnacs.110mb.com/
 
S

Stratum

Masudur said:

Thank *you*, Masudur! Your response led to a good solution.
In brief, I needed a way to reference master page controls
inside content pages that use the master. I'll repeat
it here (if only for my own future reference!)...

You have a master page, MyMaster.master, with class

public partial class MyMaster : System.Web.UI.MasterPage


In this class, you expose public properties or methods.

Then, in a content page, you use the Reference directive,

<%@ Reference Control = "~/MyMaster.master" %>

In the content page's code-behind (I use C#), you have
something like,

(MyMaster)myMasterPage = (MyMaster) this.Page.Master;

Then the public objects in myMasterPage are exposed in
this content page.

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top