Media player in gridview

May 4, 2010
Reaction score
first i want to say that i'm a beginner in and c# so it's not easy for me to understand lots and lots of code. So, for my website i'm making a gridview with some data. One of those fields contains a filename. I want to be able to take the value of that field and use it to create a media player in the same row (after every row a mediaplayer playing a different file). I can create a media player with a certain url but here you have to use a variable or something. I have tried some things but with my small knowledge of i wasn't able to make it work.

Here is what I got already:
<asp:GridView ID="GridView1" runat="server" BorderStyle="None" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" AllowPaging="True" CellPadding="1"
<asp:BoundField DataField="Artiest" HeaderText="Artiest"
SortExpression="Artiest" />
<asp:BoundField DataField="Lied" HeaderText="Lied" SortExpression="Lied" />
<asp:BoundField DataField="Album" HeaderText="Album" SortExpression="Album" />
<asp:BoundField DataField="Genre" HeaderText="Genre" SortExpression="Genre" />
<asp:BoundField DataField="Gebruikersnaam" HeaderText="Gebruikersnaam"
SortExpression="Gebruikersnaam" />
<asp:BoundField DataField="Bestand" HeaderText="Bestand"
SortExpression="Bestand" ReadOnly="True" />
<asp:TemplateField HeaderText="Beluister"><ItemTemplate>Mediaplayer here (can't submit links on this forum yet) </ItemTemplate></asp:TemplateField>
<%--<asp:CommandField ShowDeleteButton="True" />--%>
<asp:LinkButton ID="LinkButton1" Runat="server" OnClientClick="return confirm('Are you sure you want to delete this record?');"
<asp:TemplateField><ItemTemplate><button type="button" onclick="Verplaats">Keur Goed</button> </ItemTemplate></asp:TemplateField>



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads