tags:

views:

48

answers:

0

I have a button in a repeater that needs to bind XPath data to an argument

<asp:Repeater ID="DVDRepeater" runat="server" DataSourceID="XmlDataSource1">
                <ItemTemplate>
                    <img src='images/products/<%#XPath("image")%>' title='<%#XPath("@name")%>' alt='<%#XPath("@name")%>'
                        style="float: left;" />
                    <div style="float: right; width: 320px;">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%#XPath("description")%>
                        <br />
                        <br />
                        <div style="clear: both;">
                        </div>
                        <div style="width: 100%; float: right;">

                            <asp:LinkButton CssClass="img_button button_preview" 
                                            OnCommand="RollVideo_Command"
                                            CommandArgument='<%#XPath("video")%>' 
                                            ID="BtnRollVideo"
                                            runat="server" 
                                            Text="Preview" />&nbsp;&nbsp;&nbsp;&nbsp;

                            <asp:HyperLink CssClass="img_button button_read" ID="btnRead" runat="server" NavigateUrl="~/Products.aspx" Text="Read" /><h2 style="float:right;">$<%#XPath("price")%></h2></div>

                    </div>
                </ItemTemplate>
                <SeparatorTemplate>
                    <div style="clear: both; height: 30px;">
                    </div>
                </SeparatorTemplate>
                <FooterTemplate>
                    <div style="clear: both;">
                    </div>
                </FooterTemplate>
            </asp:Repeater><asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/Products.xml"
    XPath="Products/Product[contains(@category,'DVDS')]" />

but the problem I am having is that it's just not working ... the video is not firing.

    Protected Sub RollVideo_Command(ByVal sender As Object, ByVal e As CommandEventArgs)
    'Wolf Snaring
    If e.CommandName = "RollVideo" Then
        With MediaPlayer1
            .AutoPlay = True
            .ScaleMode = System.Web.UI.SilverlightControls.ScaleMode.Zoom
            .MediaSource = "trailers/" & e.CommandArgument
            .PlaceholderSource = Settings.Video.BackgroundImage
            .PluginBackground = Drawing.ColorTranslator.FromHtml("#21120a")
            .Width = 280
            .Height = 210
            .MediaSkinSource = "~/App_Themes/WolfTrapping/MediaPlayerSkins/" & Settings.Video.SkinToUse & ".xaml"
        End With
    End If
End Sub

Any help here would be greatly appreciated.