Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Aspnet Audio Control with ajax slider extender

$
0
0

Hi..I need to control volume of aspnet audio control using the slider extender in ajax. I have a listview in which every item click plays an mp3 file. Also at each click i assign the current value fron slider to the volume of audio control so that the volume is not reset each time the user clicks on an item. But the problem is that the slider extender does not increase the volume but only decreases it from the last value set.How do I overcome this problem..please help..

The .aspx page  

<asp:TextBox ID="TextBox2" runat="server" Width="80" Visible="true"></asp:TextBox>

<asp:TextBox ID="TextBox1" runat="server" onchange="javascript:SetV(this.value);" Text="50"></asp:TextBox>

<cc2:SliderExtender ID="sliderVolume" runat="server" Maximum="100" Minimum="0" TargetControlID="TextBox1"

Orientation="Horizontal" RaiseChangeOnlyOnMouseUp="False" Length="100" BoundControlID="TextBox2">

</cc2:SliderExtender>

<script type="text/javascript">

function SetV(VolumeValue) {

ASPNetMedia.Audio('<%=Audio1.ClientID %>').SetVolume(VolumeValue);

}

</script>

codebehind

protected void lstPhrases_ItemCommand(object sender, ListViewCommandEventArgs e)

{

Audio1.AutoPlay = true;

Audio1.AudioURL = path;

Audio1.Loop = false;

Audio1.LoopCount = 0;

if (TextBox1.Text != "")

{

Audio1.Volume = Convert.ToInt32(TextBox1.Text);

}

}

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>