我在ASPX文件中使用此代码:如何在后面的代码中设置视频标签的来源?
<video width="320" height="240" autoplay="autoplay">
<source id="videoSrc" runat="server" type="video/mp4"/>
Your browser does not support the video tag.
</video>
,但是当我在后面的代码使用此代码:
protected void Page_Load(object sender, EventArgs e)
{
videoSrc.Src= "UploadMovies/"+Request.QueryString["id"]+"/high.mp4";
}
,并叫我的页面myPage.aspx?id=1
我得到<source>
此错误:
The base class includes the field 'videoSrc', but its type (System.Web.UI.HtmlControls.HtmlSource) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).