I am attempting to retrieve a filename from my database and load it into the VideoURL property of a standard ASPNETVIDEO MediaCenter control.
The filename returns as empty when attempting to do so.
I can load the filename string into a label without issue.
I am using a Datalast bound to a Data source on the page. I have the video file in the same folder as the page. I am using Visual Web Developer 2008.
Aspx:
Code:
Code: <asp:DataList ID="DataList1" runat="server" BackColor="White"
BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataKeyField="VideoID" DataSourceID="SqlDataSource1"
GridLines="Horizontal" ondatabinding="DataList1_DataBinding">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<AlternatingItemStyle BackColor="#F7F7F7" />
<ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<ItemTemplate>
<table class="style1">
<tr>
<td class="style2" valign="top">
<br />
<asp:Label ID="Label1" runat="server" CssClass="subheading"
Text='<%# Eval("Title") %>'></asp:Label>
<br />
<br />
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Eval("Description") %>' />
</td>
<td> <asp:Label ID="Label2" runat="server" Text='<%# Eval("FileName") %>'></asp:Label>
<ASPNetVideo:WindowsMedia ID="WindowsMedia1" runat="server"
VideoURL='<%# DataBinder.Eval(Container.DataItem,"filename")%>'>
</ASPNetVideo:WindowsMedia>
</td>
</tr>
<tr>
<td class="style2" valign="top">
</td>
<td>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:AIHSConnectionString %>"
SelectCommand="SELECT * FROM [AIHS_getVideo]"></asp:SqlDataSource>
When I databind to a label control, it works fine. I can see the filename displayed.
The VideoURL paramter doesn't seem to like being databound or something.