我在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).