Link to home
Start Free TrialLog in
Avatar of heyday2004
heyday2004

asked on

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?
Avatar of mmarinov
mmarinov

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
ASKER CERTIFIED SOLUTION
Avatar of ihenry
ihenry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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>
--
Avatar of heyday2004

ASKER

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial