473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Changing a Master Sheet control when navigating between content pages

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
2 1692
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
7
by: Martijn Saly | last post by:
Hi there, I've created a master page with some controls on it, a Calendar control among others. Now depending on the date(s) selected, the content page needs to be updated. In the masterpage...
7
by: sasquatch | last post by:
Hi, I've a a site with nested master pages and content pages. I tried using a theme with a stylesheet in the app_themes directory referencing it in the web.config file from a pages tag theme...
1
by: Rob R. Ainscough | last post by:
I'm running into a problem with Master Pages. I have some "absolute" controls (labels, textboxes) that I position on the page using: ControlObject.Style.Add("Top", "250") or ...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
8
by: JT | last post by:
Hi, I have done a fair amount of style editing inline in ASP. I'm now using VS 2005 with a standard web project (not Web Application Project). This is my first foray into CSS in a style sheet...
4
by: Sam | last post by:
I have an asp.net 2.0 app that uses a sitemap, Master Page, and has several content pages. While this feature has simplified the process of creating a data-driven site menu, it does seem to have...
4
by: Torben Laursen | last post by:
I want to change the label of a component that I have on a masterpage but I cannot get my hands on it I have a mastepage MP2 that has a button called B2 masterpage MP2 uses masterpage MP1 that has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.