By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,717 Members | 2,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,717 IT Pros & Developers. It's quick & easy.

Changing a Master Sheet control when navigating between content pages

P: n/a
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.


Jun 25 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jun 25, 9:54 am, Stratum <stratum...@comcast.netwrote:
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/micro...d7eda8c42d10f0

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

Jun 25 '07 #2

P: n/a
Masudur wrote:
On Jun 25, 9:54 am, Stratum <stratum...@comcast.netwrote:
>>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/micro...d7eda8c42d10f0

Thanks
Masudur
http://munnacs.110mb.com/
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

Jun 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.