ASP.NET如何通过后台数据库提供的链接播放视频(不使用外置插件)

时间:2022-12-02 20:03:33

1.后台视频数据库:

ASP.NET如何通过后台数据库提供的链接播放视频(不使用外置插件)

2.aspx中的关键代码:

 <asp:DataList ID="DataList2" runat="server" DataKeyField="商品编号"  class="table_mingxing"
DataSourceID="SqlDataSource3" RepeatColumns="4" CellPadding="0"
CellSpacing="2">
<ItemTemplate>
<div >
<video width="100%" controls="controls" autostart='false'>
<source src="<%# Eval("Src") %>"></source> type="video/mp4"/ >
</video>
</div>
<br />
<asp:Label ID="Label3" runat="server" Text='<%# Eval("备注") %>'></asp:Label>
</ItemTemplate>
</asp:DataList><asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:phone %>"
SelectCommand="SELECT * FROM [商品] where 商品类型编号='9'"></asp:SqlDataSource>

3.css样式:

.table_mingxing span{ color:#;}
.table_mingxing div{ width:380px; height:200px}

4.结果

ASP.NET如何通过后台数据库提供的链接播放视频(不使用外置插件)