[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Give sound to ASP.NET page. How to make the system beep after the page is loaded?

I have an application, i want to have it beep when the page id finished loading. Is there any way that doesn't leave any media player, graphs, on the end page when playing? All i need is just  a beep after page is loading. I used:
<img dynsrc="images/chimes.wav" />

But doesn't work except leave an image sign in the end page. Any idea to play chimes.wav for the confirmation of valid user input?
0
heyday2004
Asked:
heyday2004
  • 2
  • 2
2 Solutions
 
mmarinovCommented:
Hi heyday2004,

try something like that

<script language="javascript">
function play()
{
    document.forms[0].bgs1.disabled=true;
}
</script>

<body onload="play();">
<bgsound src="images/chimes.wav" disabled="true" id="bgs1">

Regards!
B..M
mmarinov
0
 
ihenryCommented:
I was using the trick below, give it a try

http://www.tips-tricks.com/sound.asp
0
 
ihenryCommented:
Excerpt from the article

--
WIDTH and HEIGHT This is how the sound control (console) will be displayed. Setting them as the given numbers, browsers will display a full console. Setting the width=0 and height=2, the console will not displayed by the browsers. Other values that too small will cause the browsers display uncompleted image. You might also hide it by placing HIDDEN=true like this: <EMBED SRC=your_file.mid AUTOSTART=true HIDDEN=true LOOP=1>
--
0
 
heyday2004Author Commented:
Thanks a lot! ihenry: I tested what you suggested and it works!

mmarinov: I tested the javascript, but it always reported something like: document.forms[0].bgs1: null object, etc. Have you met this before?

Thanks again and i will split the points later today.
0
 
mmarinovCommented:
may be because there is id attribute instead of name

<bgsound src="images/chimes.wav" disabled="true" name="bgs1">

but if the ihenry solution is correct and it is working - i think that the question is answered :-)
don't worry about the points

B..M
mmarinov
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now