|
|
Rank: Guest Groups: Guest
Joined: 7/20/2007 Posts: 53,654 Points: 100,812
|
Hi I am using the Suite and have successfully inserted the license file. I have a page which plays an mp3 just fine, but now I would like to pass the URL to the control when the page loads, not hard coded. Can this be done in VB? I Have tried eg. like this ( where SelectedFile is set to the required mp3 filename in the code behind onLoad)
<ASPNetAudio:Audio ID="Audio1" runat="server" AudioURL="~/mp3/<%=SelectedFile%>"> </ASPNetAudio:Audio> Same for the play button.
It does not give an error, but does not play the file either.
Please sort me out! Thanks Clive
|
|
Rank: Administration Groups: Administration
Joined: 7/26/2007 Posts: 676 Points: 1,728 Location: USA
|
Yeah - just set the VideoURL property using VB http://www.aspnetmedia.com
|
|
Rank: Newbie Groups: Member
Joined: 10/6/2008 Posts: 1 Points: 3
|
I am using this page markup <form id="form1" runat="server"> <div> <ASPNetAudio:Audio ID="Audio1" runat="server" AudiURL="" AutoPlay="False" Streaming="True" AudioURL="~/mp3/<%=strFileName%>" > </ASPNetAudio:Audio> </div> <ASPNetMediaGUI:PlayButton ID="PlayButton1" runat="server" AssociatedControl="Audio1"> </ASPNetMediaGUI:PlayButton> <ASPNetMediaGUI:StopButton ID="StopButton1" runat="server" AssociatedControl="Audio1"> </ASPNetMediaGUI:StopButton> </form>
and a page load event
<script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim strFileName As String = "21-09-2008.mp3" End Sub </script>
It does not run like thisbut if the file name is hard coded it runs OK
Is the page load event the wrong one to set the value of strFileName?
Or I am going in the wrong direction?
Help!
Clive
|
|
Rank: Administration Groups: Administration
Joined: 7/20/2007 Posts: 305 Points: -2,485 Location: Primarily in New York, USA
|
Clive, I'd either set the AudioURL in the code behind, or with a method. However what you're doing should work, if the syntax were correct, which I'm not sure that it is. Try this: Code: <ASPNetAudio:Audio ID="Audio1" runat="server" AutoPlay="False" Streaming="True" AudioURL='<%= "~/mp3/" + strFileName %>' > </ASPNetAudio:Audio>
otherwise: Code:
Audio1.AudioURL = "~/mp3/" + strFileName;
or (this is pseudocode really, don't copy and paste) Code:
ASPX:
<ASPNetAudio:Audio ID="Audio1" runat="server" AutoPlay="False" Streaming="True" AudioURL='<%= getURL() %>' > </ASPNetAudio:Audio>
C# Codebehind:
getURL() { return "~/mp3/" + strFileName; }
good luck -dave
|
|
|
Guest |