Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 需要一个代码为youtube缩略图播放按钮后,我点击播放视频将在弹出窗口播放_Asp.net_Video_Youtube_Embed - Fatal编程技术网

Asp.net 需要一个代码为youtube缩略图播放按钮后,我点击播放视频将在弹出窗口播放

Asp.net 需要一个代码为youtube缩略图播放按钮后,我点击播放视频将在弹出窗口播放,asp.net,video,youtube,embed,Asp.net,Video,Youtube,Embed,我需要一个代码为youtube缩略图与播放按钮,从url获取视频id后,我点击播放视频将在弹出窗口播放。。。谁能建议 .aspx代码: <asp:DataList ID="DataList3" runat="server" RepeatDirection="Horizontal" RepeatColumns="7" Width="600px" DataSourceID="SqlDataSource1"> <ItemTemplate>

我需要一个代码为youtube缩略图与播放按钮,从url获取视频id后,我点击播放视频将在弹出窗口播放。。。谁能建议

.aspx代码:

<asp:DataList ID="DataList3" runat="server" RepeatDirection="Horizontal" 
            RepeatColumns="7" Width="600px" DataSourceID="SqlDataSource1">
        <ItemTemplate>
             Description:
             <asp:Label ID="DescriptionLabel" runat="server" 
                 Text='<%# Eval("Description") %>' />
             <br />
              <object width="200" height="200"><param name="movie" value='<%#DataBinder.Eval(Container.DataItem, "url") %>'></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src='<%#DataBinder.Eval(Container.DataItem, "url") %>' type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="200" height="200">
</embed>
</object>
             <br />
             <br />
        </ItemTemplate>
        </asp:DataList>

从一个love代码中,我可以在数据列表中看到youtube视频,但当我点击它时,它会像200px*200px那样播放。

我会用不同的方式来做

就个人而言,我不会嵌入视频,因为这是个问题!相反,如果嵌入视频图片或类似内容,onclick会在新窗口中加载相应的视频

也要更新你的模板

<ItemTemplate>
             Description:
             <asp:Label ID="DescriptionLabel" runat="server" 
                 Text='<%# Eval("Description") %>' />
             <br />
         <a href="wherever" javacriptCommandToOpenPopUpHere><img src="picture.jpg"></a>
<br /><br />
</ItemTemplate>

说明:



您可能还需要更新Insert命令,因为它可能允许SQL注入。

您能给我举个例子吗?
<ItemTemplate>
             Description:
             <asp:Label ID="DescriptionLabel" runat="server" 
                 Text='<%# Eval("Description") %>' />
             <br />
         <a href="wherever" javacriptCommandToOpenPopUpHere><img src="picture.jpg"></a>
<br /><br />
</ItemTemplate>