代码的第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());   上一页 [1] [2] [3] 下一页 |