我想将媒体播放器网址设置为我从Session [“song”]获取的新网址如何设置,并且任何人都可以告诉我在我的代码中做错了什么:
protected void Page_Load(object sender, EventArgs e)
{
string url = ((string)(Session["song"]));
Label5.Text = url; // url value here displaying correct, but how to set that to media player???
}
在aspx页面中我有媒体播放器代码:
<OBJECT Id="Player" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701" STANDBY="Loading Microsoft Windows® Media Player components..." TYPE="application/x-oleobject" width="280" height="46">
<param name="URL" value="+url+" />
<param name="enable" value="true" />
<param name="animationatStart" value="true"/>
<param name="transparentatStart" value="true"/>
<param name="autoStart" value="true"/>
<param name="showControls" value="true"/>
<param name="Volume" value="-300"/>
<embed Id="Player" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="+url+" width=280 height=46 autostart=1 showcontrols=1 volume=-300 />
</OBJECT>
答案 0 :(得分:1)
将您的aspx媒体播放器嵌入代码的第二行替换为以下行
<param name="URL" value='<%= Convert.ToString(Session["Song"]) %>' />