VS 2010 - Playing Audio Clip On Button Event

Apr 11, 2013

i want to play a sound file using following code in my aspx page

<asp:Button ID="btnPlay" runat="server" Text="Play" />

<script type="text/javascript">
function EvalSound(soundobj) {
var thissound = document.getElementById(soundobj);
thissound.Play();
}
</script>
<embed src="doorbell-1.wav" autostart="false" width="1" height="1" id="sound1" enablejavascript="true" >
</embed>

and then calls following code on my aspx.vb code page on page_load

btnPlay.Attributes.Add("onclick", "return EvalSound('sound1');")

but dinot hear any sound

where if i use html button instead it works fine like this

<input type="button" id="btnPlay" onclick="EvalSound('sound1');"/>

View 2 Replies


Similar Messages:

Playing Video/Audio In Webpage In 3.0?

Jul 23, 2010

i need to embedd a video player on web form, that will be able to play almost every ormost of the known video/audio formats....(mpeg, flv, avi, 3gpp, wmv, wma)..i need only a single player.....to be embedded....and it shuld not use the pc's local players..

View 6 Replies

Web Forms :: Creating New Folder In Server And Video / Audio Uploading And Playing

Oct 15, 2010

I am a Bigner in asp.net c# learning. How can i create a new folder in server from my c# program. in my semester asp.net project, i want to upload video/audio files into my own newly created folder and the storing folder's name must be given by me, which means each time folder name may change during uploading time. and how can i give a picture link to that vodeo files containing in different folders and how can i play that files in the browser using a player.

View 1 Replies

Data Controls :: Playing Audio Files Using Path Stored In Database?

Jun 25, 2012

how to play an audio file on my website using The Song Path stored in the database

View 1 Replies

VS 2010 / Page Rewritten Before Button Event?

Jun 14, 2012

I have a textbox and a button on a page. When the user clicks the button, it calls a function in the codebehind that inputs the text from the textbox into a sql table. Or at least it should. I can't get it to work properly.

Here's what I have.

ascx file:

Code:
<asp:Label ID="lblTicketComments" runat="server" Visible="false"></asp:Label>
<asp:TextBox ID="txtNewCommentText" runat="server" CssClass="NewCommentText" TextMode="MultiLine"></asp:TextBox>
<asp:Button id="btnNewCommentSubmit" Text="Add Comment" runat="server" OnClick="NewCommentSubmit_Click" />
ascx.cs file:

Code:
protected void Page_Load(object sender, System.EventArgs e)
{
btnNewCommentSubmit.Click += new EventHandler(this.NewCommentSubmit_Click);
if (UserCanSeeThisTicket())
{
PrintTicketComments(); //outputs the comments to lblTicketComments
PrintlblNewTicketStuff();

[code]....

It seems the page is being reloaded before PostComment(); is ever executed, because no matter what I type in the text box, it always posts to SQL as "Write Comment Text Here..." However, if I remove the button click even and just put PostComment() in Page_Load under if(this.IsPostBack), it works fine. (but this is not ideal because I will need other buttons later which will cause a postback) So what am I doing wrong?

View 4 Replies

VS 2010 - Repeater Button Click Event

Mar 8, 2012

I have an ASP:Button inside a Repeater control. The repeater is databound in code-behind. The Button text is populated with the data field value. When I click on one of the buttons, I want the text value to update a variable whos value is used to re-query the sql tables and redisplay the page. What I have so far does not update the value when one of the buttons is clicked.

Code:

asp code for the repeater:
<asp:Repeater ID="rptYears" runat="server" OnItemCommand="yr_ItemCommand">
<ItemTemplate>
<asp:Button ID="btnYear" runat="server" CssClass="yrBtn" Text='<%# Eval("YR") %>' />
</ItemTemplate>
</asp:Repeater>

vb code:
Public Class AssessDetails
Inherits System.Web.UI.Page
Dim theTaxkey As String = ""
Dim theYear As Short

[Code] ....

View 10 Replies

VS 2010 - Event Handler For A Button Created Programmatically

Jan 25, 2012

I need to generate a button way after the page loads but I can't work out how to deal with the Event handler. If I do this when the page loads as shown bellow it works as intended but if I use the exact same method in a button it fails. (it creates the button but when I click the button it just disappears instead of showing a msgbox."I know I shouldn't use Msgbox in a web form but I only do it as a test then remove it"

Code:
Partial Class Default3
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim mybutton As Button
mybutton = New Button
mybutton.Text = "Submit"

[code]...

View 1 Replies

Web Forms :: Play Audio From A Database Using Audio Or Flash Player

Mar 7, 2011

I am working on an ASP.NET Web application and I want it to have audio playback functionality. I can do is using directories. For example, using the ASP.NET Audio control like :- , is pretty easy and straight-forward and works accordingly. But, the trouble comes when I'm using a database and the control. I am totally new to data binding in ASP.NET. I don't like using JavaScript, but i am comfortable using it, but I would prefer C# solution (I know beggars can't be choosers).

I have a database containing only one table called tblAudio. This table has two fields only for the title of the audio file (type NVARCHAR(MAX)) and the field for the actual audio (type VAR BINARY(MAX)). I'm using Visual Studio 2010 Professional with SQL Server Express Edition. The table has a single record with the relevant data in their fields.

View 1 Replies

Web Forms :: How To Add Audio Play Button

May 24, 2010

how can i add audio play button to play mp3 file

View 3 Replies

Which Method Alows The URL Of The Audio To Be Hidden When Others Embed The Audio ?

Dec 12, 2010

Adobe Flash or QuickTime..???

I assume Flash is not available via Ipads???

Which method alows the URL of the audio to be hidden when others embed the audio ?

View 4 Replies

Clip Text In C# After The Third Word?

Jan 20, 2011

I have a text(title) which has values like "Zesty Bean Bites South of the Border ". I need to add ... after the 3rd word in title .How can we achieve this ? i tried using Substring() method but it wont split by words ?

View 1 Replies

Clip Text In C# After The Third Word?

Jan 5, 2011

I have a text(title) which has values like "Zesty Bean Bites South of the Border ". I need to add ... after the 3rd word in title .How can we achieve this ? i tried using Substring() method but it wont split by words ?

View 4 Replies

Web Forms :: How To Add Print And Copy To Clipboard To Clip

Aug 6, 2010

I want to add a print and copyto clipboard option to my grid

when ever i will click on print or copy to clipboard i will give the same result what i have in grid

View 6 Replies

What's The Difference Between Button.click Event And Button.command Event

Sep 24, 2010

Whats the difference between Button.Click Event and Button.Command Event in asp.net?

View 1 Replies

Master Page Button Event Overloading By Content Page Button Event When Enter Key Is Pressed?

Nov 29, 2010

I have two search options:

1. On Master Page there is a text box and button for search.

2. on content page there is form for with two texboxes and a button for search.

Now whenever i press enter key from keyboard, the masterpage button event is fires.

I mean in every case when I press enter key from keyboard the same event is called.

I want If someone fill the content page search form and press enter key, it fires content page event.I am doing it like this:

[code]....

but not working

View 1 Replies

Web Forms :: Button Event Be Called From Another Button Event?

Sep 17, 2010

I have a search page. Based on the user that is logged in, a link will display if they have saved any previous search criteria. If you have any, the link will open a modalpopup with a list of all your saved searches. I have it setup so when you select the search you want to perform, it will take those values and populate the search form for you. What i would like to do is if you select something from the list, after the fields are populated(which is already working) i would like that searches button event to be executed so the search values are passed in and the results are shown instead of having them press the search button again.

I tried adding this to my select event but thats not correct i know.. so is it possible to execute another buttons event?

btSearchDVR_Click();

View 3 Replies

Web Forms :: How To Capture The Onbeforeunload Event And Trigger The Previous Button Click Event

Nov 17, 2010

i am currently developing an asp.net project. there is a previous, next, and cancel button that the user can utilize, but the problem is that everything is broken into controls so that if they hit the browser's back button it will reset everything and take them to the very beginning. i would like to capture the onbeforeunload event and trigger the previous button click event (i.e. treating navigation like clicking the previous button).

View 6 Replies

Forms Data Controls :: DataGrid Button And Event In Footer, Event Not Getting Fire

Sep 3, 2010

I have one Datagrid with Footer. Footer Row Contains Input fields with one Button to add New Values. I have button click event but not getting fires. my code follows:

[code]....

View 2 Replies

Forms Data Controls :: How To Call A Button Click Event On From An Event Handler

Sep 29, 2010

I got an event handler like this, in this event, i wanted to call another button click event. How can I do that?

[Code]....

if (ds.Tables[0].Rows.Count == 0)

View 3 Replies

Web Forms :: Avoid Button Click Event On Page Load Event?

Dec 28, 2010

i have an form with an button and some input controls. some time due to input problem i may get error after that if i refreshed the page then that time the button click event has fired, how to avoid this kind of bad event fire.

View 3 Replies

Web Forms :: Text Change Event Eats Up Button Click Event?

Feb 18, 2011

I have a textbox with autopostback=true and a button to save the data in the form. Functionality works fine when entering a value in the textbox, tabbing out of the textbox and clicking on the save button. But issue comes up when entering a value in the textbox and directly clicking on the save button without tabbing out of the text box. In the second scenario, only textchanged event fires and save click event dosen't fire. What I was expecting was after exection of textchanged event, save click event should also fire. But this is not happening.

View 5 Replies

Dropdown Selected Change Event Fire On Button Click Event?

Sep 24, 2010

I have write the code in .Net. When I click the Buttun then fired below event.

protected void ddldesignation_SelectedIndexChanged(object sender, EventArgs e)
{
Code.
}

View 1 Replies

C# - Button Event Does Not Fire, As Its Being Blocked By Another Event On Dropdown Occurs (uxFromDate_TextChanged)

Nov 23, 2010

I have a button which has a click event but its not firing on the first click. I suspect its something to do with that i am in dropdown box control so when i click the Button the event for the dropdown box occurs (textChanged) but it forgets about the click event

Of course if i click it a second time it works.

Or if i click somewhere else first so that the event TextChange occurs and then click the Button the first time it executes..

Is this normal and what are more workarounds if any?

basically the TextChange event must fire but the button click event must fire as well.

All the events i am talking about are ASP.NET events.

here is some examples of the events i am using - both the button and dropdown

uxGetData is a button and uxToDate is a dropdown box

[code]....

View 1 Replies

Web Forms :: Frame Event Handler / Call An Event From The Second One After Clicking A Button In The First One?

Jan 26, 2010

i have two frames in a page. the fist one contains buttons the second one the form. i want to call an event from the second one after clicking a button in the first one ,

View 3 Replies

Web Forms :: Records Never Get Updated On First Button Click Event But Works On Second Event

Oct 5, 2012

I am updateing my gridview using button click event but at the fisrt time it does not get updated first time but its works second time i dont know why . Dol u know how to genterate two button click event for the same button.Records never get updated on first button click event but its works on second button click  event.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved