Rank: Newbie Groups: Member
Joined: 1/8/2010 Posts: 2 Points: 6 Location: Rocklin, Ca.
|
I have made numerous attemps trying to dynamically bind a playlist to the ASPNetAudioGUI control. The gridview (playlist) appears ok, but when I select on the link to listen to the song I get the following error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.Table'.
Here's a copy of my form code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <ASPNetAudio:Audio ID="MediaPlayer1" runat="server" Volume="100"> </ASPNetAudio:Audio> <h3> PlayList:</h3> <ASPNetMediaGUI:PlayList ID="PlayList1" runat="server" AutoGenerateColumns="False" CellPadding="4" GridLines="None" LoopPlayList="false" AutoPlay="false" MediaPlayer="MediaPlayer1" SelectedTrack="1" ShowHeader="False" ForeColor="#333333"> <FooterStyle BackColor="#990000" ForeColor="White" Font-Bold="True" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:TemplateField ShowHeader="False"> <ItemTemplate> <asp:LinkButton ID="TrackSelectButton" runat="server" CausesValidation="False" CommandName="Select" Text='<%# Eval("Name") %>'></asp:LinkButton> </ItemTemplate> </asp:TemplateField> </Columns> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> </ASPNetMediaGUI:PlayList> </ContentTemplate> </asp:UpdatePanel>
Here's a copy of the server side code:
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List<Song> songMatchList = new MatchListLogic().GetMatchListSongsByFilters(73, false, false, false, Int32.Parse(SystemConfigurationLogic.UIMatchListMaxRows)); ASPNetMediaGUI.PlayListTrack playListTrack;
foreach (Song s in songMatchList) { playListTrack = new ASPNetMediaGUI.PlayListTrack(); playListTrack.Name = s.Name; playListTrack.URL = s.URL; PlayList1.PlayListTracks.Add(playListTrack); } //I've also tried binding the generic list as a datasource with no luck //PlayList1.DataSource = songMatchList; //PlayList1.DataBind(); } }
Am I missing somthing here? If anyone has a working example of data binding to the play list I would greatly appreciated it. This is getting extremely frustrating. Thanks in advance.
|
Rank: Administration Groups: Administration
Joined: 7/20/2007 Posts: 302 Points: -2,494 Location: Primarily in New York, USA
|
I would start with this demo here: http://www.aspnetaudio.com/aspnetaudio_Demonstration-Music-Playlisting.aspxIt's downloadable as part of our SDK, which contains working demonstrations of all of our software. If this doesn't help you on your way let me know and we'll figure something out. Thanks! -Dave
|