Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
i want to now that, How do i am stop a previous audio file when another audio file starts in datalist. Below is my code for datalist. Here bold area shows my audio file binding control.

<b>My problem is when i play one audio file and then play next audio file previous file is not stopped. </b>

What I have tried:

<asp:DataList ID="dlbrowsevents" OnItemDataBound="dlbrowsevents_ItemDataBound" RepeatColumns="3" runat="server">
<ItemTemplate>
    <div class="col-xs-12 col-sm-12 event1">
        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Image") %>' class="img-responsive" Width="700px" Height="250px" />
		
        <asp:Panel ID="pnltime" Visible="true" runat="server">
            <p>
                <asp:Label ID="lblStartDate" runat="server" Text='<%# Eval("StartDate", "{0:dd/MM/yyyy}") %>'>
                <asp:Label ID="lblStartTime" runat="server" Text='<%# Eval("StartTime") %>'><br />
            </p>
            <asp:Panel ID="pnlmusic" Visible="false" runat="server">
                <div id="divmusic"  runat="server">
                    <div class="form-group">
                        <audio controls="controls" loop="loop" style="height:25px; width:100%">
                            <source src="<%# Eval("MusicUpload") %>" type="audio/ogg" />
                        </audio> 
                    </div>
                </div>
                
                <h5>
                    <b>
                        <asp:Label ID="lblLocation" runat="server" Text='<%# Eval("EventTitle") %>'>
                    </b>
                </h5>
				
                <asp:HiddenField ID="hdfdStatusType" Value='<%# Eval("StatusType") %>' runat="server" />
				
                <hr>
</ItemTemplate>
Posted
Updated 8-Jun-16 3:03am
v3
Comments
VR Karthikeyan 8-Jun-16 5:25am    
Not enough information. you just show asp code only. we don't know whats happening in codebehind. Just provide some more details like the code you have tried, improve the question.
Gaurav Pal 26 8-Jun-16 5:28am    
i am only bind the data from sql server with datalist in my code behind file
Richard Deeming 8-Jun-16 9:04am    
You need to HTML-encode your code block, otherwise it doesn't appear.

I've fixed the formatting for you, but it looks like part of your ItemTemplate was lost.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900