Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Playing a sound using an IF statement in ASP

Posted on 2003-03-25
12
Medium Priority
?
165 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
9 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
Technology Partners: 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

580 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