473,322 Members | 1,480 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,322 software developers and data experts.

how to change images in masterpage using java script?

i m using a master page in my project and that page contains an image tag . i want to change images in that image tag by using java script after fixed time interval. my technology is asp.net. is it possible ? and those changed images should be work in all pages. so help me ???? bye
Mar 17 '10 #1
2 2336
Frinavale
9,735 Expert Mod 8TB
In your JavaScript you should use the document.getElementById('id') method to get a reference to the image tag that you want to work with. You can change the element's src property to change the image via JavaScript.

The tricky part is knowing how to retrieve the "id" for the image element.

If your image is an ASP.NET Image control then the "id" that you want to supply to the document.getElementById() method is the image control's ClientID property.

If your image is a pure HTML <img> tag then you supply the id that you gave this image to the getElementById method.

It is probably better to work with the ASP.NET Image control rather than use the HTML <img> tag because ASP.NET will assign unique IDs to the elements, making your HTML valid. Also, if you use the ASP.NET Image control you can access it in your C# or VB.NET server side code....

Anyways, check out this quick article on How to use JavaScript in ASP.NET.

-Frinny
Mar 17 '10 #2
thanks a lot i will try ur idea and will tell you later
Mar 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load...
2
by: Marcus | last post by:
I am after what is probably very basic help. Below is the HTML including the bit of Java I am trying to understand why its not working. The idea is as the mouse moves over and off the "button"...
2
by: Nick Calladine | last post by:
Is this possible to ... I wish to get the value of a dropdown select but gets is indexable value (dont know if that is the right term) if that is possible (the position it assigned get assigned...
1
by: Pugi! | last post by:
I wonder if it is possible to slice images with javascript. So that you can create a wave effect when the image is shown on screen. I think it's possible to do it with let's say 7 div's...
5
by: Wolff | last post by:
Hi All, I'm coding a page in which I would like a .js menu to overlay an image. The problem is this: putting the menu between two images gets it to appear where I want it, but it also creates a...
7
by: Bon | last post by:
Dear all I create a master page with image buttons on the left-hand side for navigation. When a user clicks the student button, the content (i.e. ContentPlaceholder) in masterpage will be...
1
by: ttamilvanan81 | last post by:
Hai everyone, I need to provide the slideshow for the images. I have upload the images into database. Then i will retrive all the images from the database and provide the slideshow for those...
1
by: Charlie | last post by:
Hi: Before MasterPage, I preloaded images for rollovers in HEAD section no problem. Doesn't seem to work with MasterPage. Using same code, images never load. Always pulled from disk. Am I...
7
by: John | last post by:
Hi there, I have a CSS based menu in a master page that uses class attributes to determine which item is currently selected. So, for example if the Homepage is currently the active page then...
2
by: kurt sune | last post by:
Hello, I have a weird problem, I hope someone can explain this for me. I have a webpage using masterpage. In it I create a popup window using this code: Dim js As String = "<script...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.