Dynamic rich media component for ASP.Net Flash, Video, Audio, FlashVideo and ToolTip / Balloon Help controls for C# and VB.Net
Welcome Guest Search | Active Topics | Members | Log In | Register

VideoURL not accepting Databound text entry Options · View
xiticix
Posted: Monday, June 01, 2009 5:40:47 PM
Rank: Newbie
Groups: Member

Joined: 6/1/2009
Posts: 2
Points: 6
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 />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Label ID="DescriptionLabel" runat="server"
                                    Text='<%# Eval("Description") %>' />
                            </td>
                            <td>&nbsp;<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">
                                &nbsp;</td>
                            <td>
                                &nbsp;</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.
AmitM
Posted: Thursday, July 16, 2009 4:38:27 AM
Rank: Newbie
Groups: Member

Joined: 7/12/2009
Posts: 3
Points: 9
Location: Miami
I have/had the same issue. Try assigning in ItemDataBound event:

Private Sub movieList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles movieList.ItemDataBound


If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
' set reference to current data record
Dim dataRow As BLL.cFile = CType(e.Item.DataItem, BLL.cFile)

'find the player
Try
Dim objPlayer As ASPNetFlashVideo.FlashVideo = CType(e.Item.FindControl("FlashVideo1"), ASPNetFlashVideo.FlashVideo)
objPlayer.VideoURL = String.Format("~/Pages/Secured/GetFile.aspx?FileID={0}", dataRow.FileID)
Catch ex As Exception

End Try
End If

End Sub


This sets the URL fine but my video does not play. Hopefully it works for you.

-Amit
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.