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

Posted on 2004-11-16
Last Modified: 2008-03-03
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?
Question by:heyday2004
    LVL 28

    Expert Comment

    Hi heyday2004,

    try something like that

    <script language="javascript">
    function play()

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

    LVL 20

    Accepted Solution

    I was using the trick below, give it a try
    LVL 20

    Expert Comment

    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>

    Author Comment

    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.
    LVL 28

    Assisted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now