2 <param name="_extentx" value="10160"><param name="_extenty" value="7620">
3 <param name="autostart" value="-1"><param name="shuffle" value="0">
4 <param name="prefetch" value="0"><param name="nolabels" value="0">
5 <param name="src" value="<asp:literal id='lt_src' runat='server'></asp:literal>">
6 <param name="controls" value="imagewindow"><param name="console" value="clip1">
7 <param name="loop" value="0"><param name="numloop" value="0"><param name="center" value="0">
8 <param name="maintainaspect" value="0"><param name="backgroundcolor" value="#000000">
9 </object>
那么如何让这个播放器能根据我们传的参数不同而播放不同的内容呢@上面一段html代码的第5行就指明了这个播放器播放的内容来源,为了实现能根据参数不同播放不同的内容,我们将其value值设置为一个literal控件,然后在后置代码中动态的对literal的text属性赋值就ok了。代码如下:
/**// <summary>
// author: shy520
// http://pw.cnblogs.com
// </summary>
public class showvideocontent : system.web.ui.usercontrol
{
protected system.web.ui.webcontrols.literal lt_reader;
protected system.web.ui.webcontrols.literal lt_vdate;
protected system.web.ui.webcontrols.literal lb_author;
protected system.web.ui.webcontrols.literal lt_resource;
protected system.web.ui.webcontrols.label lb_title;
/注意:写在object中的literal需要我们手工定义
literal lt_src;
private void page_load(object sender, system.eventargs e)
{
if(request.querystring["id"] != null)
{
int id = int.parse(request.querystring["id"].tostring());
/得到视频新闻内容
videocontent vc = videocontent.find(id);
lt_reader.text = vc.announcer;
lt_vdate.text = vc.vdate.toshortdatestring();
lb_author.text = vc.author;
lt_resource.text = vc.resource;
lb_title.text = vc.videotitle;
/对播放内容赋值
lt_src.text = vc.linkurl;
}
}
}