473,606 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master Pages changes my image ID; breaks JS code

Hello,

I'm converting a 1.1 app to 2.0 and decided to try out master pages. My
menu system consists of images with onmouseover/out events to highlight
selected menu items, and to display submenus. These events are attached to
javascript functions which rely on the image id to appropately locate and
swap images, display submenus at the right location, etc.

Anyways, this worked fine initially in 2.0, but when I introducted master
pages to the mix, my rendered html shows that my image ids are no longer
named as specified. Instead they are prefixed with ct100_. Consequently,
this breaks my rollover effects and javascript submenus which rely on my
originally named image ids.

As stated, my image ids were not modified until I moved the code into master
pages. Is there a way to prevent asp.net from changing my specified image
id under master pages?

Thanks.
Brian
Apr 4 '06 #1
1 2214
You probably need to generate some of your JavaScript on the fly so it can
build in the generated name of the image control. You can get the name from
the server-side ClientID property.

"anony" <an***@mous.com > wrote in message
news:PJ******** ************@to rnado.tampabay. rr.com...
Hello,

I'm converting a 1.1 app to 2.0 and decided to try out master pages. My
menu system consists of images with onmouseover/out events to highlight
selected menu items, and to display submenus. These events are attached
to javascript functions which rely on the image id to appropately locate
and swap images, display submenus at the right location, etc.

Anyways, this worked fine initially in 2.0, but when I introducted master
pages to the mix, my rendered html shows that my image ids are no longer
named as specified. Instead they are prefixed with ct100_. Consequently,
this breaks my rollover effects and javascript submenus which rely on my
originally named image ids.

As stated, my image ids were not modified until I moved the code into
master pages. Is there a way to prevent asp.net from changing my
specified image id under master pages?

Thanks.
Brian

Apr 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
2411
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the include files to change the layout. When I came to ASP.NET, I used user controls to do a similar thing. I have just been looking at master pages, and it looks like they do the same thing. If so, is there any advantage in using them over the...
5
1715
by: Nalaka | last post by:
Hi, When an image is put on a master page... the url to th eimage is set relatve to the master page. (at least don't know how top set an absolute URL to image) But the when a content page is shown, all images (inclding masterpage) are resoved relative to the content page location. get get around this I copy all master page images to the sub folders too......
2
3311
by: news.sbcglobal.net | last post by:
I hope I can explain this well enough to understand. I have a master page that is used by almost all of the pages in my site. On the master page is a table. In one of the cells in this table, I have set the background to display an image that is located in a directory called "images" which is just off the root directory. Here's the problem: Any page that is not located in the root directory (where the master page is located) cannot...
2
6970
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 header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the Content Page? TIA
8
6682
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 and also my first true attempt at using master pages. I tried setting up a style sheet with a simple setting to float an image to the right and it had no effect on the image. Then, I tried putting the style code in my ASPX file as such,
7
2010
by: TheLongshot | last post by:
I just recently converted a few pages of my application to using master pages. Problem is, in all of my content pages, the contents are centered. I can't figure out why. The markup in the content page seems to ignore any attempts to manually align right. So what's the deal?
7
1350
by: =?Utf-8?B?TWFyaw==?= | last post by:
keywords: asp.net master page rubbish I have written a custom control. The control is a simple html Tab menu control. The control inherits from DataBoundControl and implements INamingContainer, IPostBackEventHanlder and IPostBackDataHandler. The control is engineered to use a hidden client-side input textbox which stores a selected index variable to enable the IPostBackDataHandler to determine a change in tab and trigger a redraw of...
5
1514
by: =?Utf-8?B?QW50?= | last post by:
Hi, I'm a newbie to the Master page. When i drag an image directly onto the master page from say my image folder, it is reflected in all pages which use it, however, if I drag a table, layout, image control etc onto the master page, I don't see these added to any of the pages that is using the Master page as a template even after I save & rebuild. Is this expected bahaviour & if so, how do I set up say, menus using a layout or table &...
8
1288
by: Cirene | last post by:
I have 1 master page in the root of my website that I would like to share with all pages, even those in my /admin and /client directories. But when pages in the subdir's are viewed the img, css, etc... references are incorrect because they are "root based". Any suggestion as to how to overcome this? Or do I have to create another Master Page for the subdir pages? Thansk!
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8448
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8126
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6796
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3948
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2454
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.