Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Master Pages changes my image ID; breaks JS code

 
Thread Tools Search this Thread
Old 04-04-2006, 04:59 PM   #1
Default 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




anony
  Reply With Quote
Old 04-04-2006, 05:49 PM   #2
Ken Cox - Microsoft MVP
 
Posts: n/a
Default Re: Master Pages changes my image ID; breaks JS code
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" <> wrote in message
newsJwYf.110330$ m...
> 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
>





Ken Cox - Microsoft MVP
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL code for SPI Master shah_satish2002 Hardware 2 07-22-2007 08:12 PM
Classic Original Broadcasts Trading List - Updated ( w/o/c ) porkys1982@sbcglobal.net DVD Video 0 12-05-2005 03:38 AM
Classic Original Broadcasts Trading List - Updated ( w/o/c ) porkys1982@sbcglobal.net DVD Video 0 11-19-2005 04:46 PM
Original Airings : The A-Team , M*A*S*H , Taxi , Barney Miller , WKRP porkys1982@sbcglobal.net DVD Video 0 08-15-2005 03:09 AM
Image acquires Criterion Goro DVD Video 2 08-04-2005 02:28 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46