?
Solved

Playing a sound using an IF statement in ASP

Posted on 2003-03-25
12
Medium Priority
?
158 Views
Last Modified: 2012-05-04
I need to play a sound on the outcome of an IF statement in ASP. Basically I have a counter which if different from a querystring [last count] should play a sound to alert me that another bid has been made. I don't want to have to watch my page all day - just be notified using sound if the bid count is different from the value I pass from the page before refreshing it.
0
Comment
Question by:GlenStobbs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 8209365
ASP creates html pages, have your ASP script create one page (with sound in header) if new bid, or one without otherwise.

<%
request.form("lastcount")

IF counter = lastcount THEN
<%
<html>
<head><bgsound src = "URL of sound file" loop="-1"></head>
<body></body>
</html>
%>
ELSE
<%
     <html>...... same as above with out sound tag
%>
END IF
%>

Easy
0
 

Author Comment

by:GlenStobbs
ID: 8209494
not so easy ..... the current count is below the header, so this won't work. The only way I cold do this is to duplicate the count itteration before the header, but this seems too stupid to do

Glen
0
 

Author Comment

by:GlenStobbs
ID: 8209507
on second thoughts ... I could make it create a small popup that self closes, but there has got to be an event script that plays sound.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:GlenStobbs
ID: 8209578
on second thoughts ... I could make it create a small popup that self closes, but there has got to be an event script that plays sound.
0
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 8209608
How exactly is a bid made, because if it calls the asp page, does it not post the counter to it. If so you make the comparison, before creating the html page.  It sounds like your talking about using a javascript or something (i.e. popup window)

Easy
0
 

Author Comment

by:GlenStobbs
ID: 8210432
This is a watching page for admins. There is no counter on auction items, just a record in the Db. I count these records on the watch page - per lot and overall.

Anyway, I sorted this using some embedded javascript which adds the sound in the body [so i can put it anywhere in the body] - very simple. It fires the sound based on the outcome of the IF Statement. All works like a dream.

Thx
0
 
LVL 7

Expert Comment

by:5thcav
ID: 9989006
Make a hidden label

make a ddlist of songs

put this into the DropDown_SelectedIndexChanged event

Label1.Text = "<bgsound src=http:\\www.hopctech.com\christmas\" & MidiDropDown.SelectedItem.Value & " loop=0></embed>"

or just put it into the codebehind of a button.

no fuss no mess, easy peasy




0
 

Author Comment

by:GlenStobbs
ID: 10519649
Seems I have to award points to someone else when I solved it myself. Only one person came close to giving me the idea that finally solved the puzzle. To that person I will award the points and accept his solution.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10663018
PAQed, with points refunded (50)

Computer101
E-E Admin
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

741 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