Master Pages changes my image ID; breaks JS code

A

anony

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
 
K

Ken Cox - Microsoft MVP

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.
 

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,777
Messages
2,569,604
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top