public string getVideoNav() { string res = string.Empty; string lb = Request.QueryString.Get("sid"); string newsid = Request.QueryString.Get("id"); videoManager mgr = new videoManager(); if (!string.IsNullOrEmpty(newsid)) { WhereClip where = new WhereClip(); where = where && video._.id == newsid; video model = new video(); model = mgr.GetvideoItemById(where); if (model != null) { lb = model.sid.ToString(); } } if (!string.IsNullOrEmpty(lb)) { videoclass modelclass = new videoclass(); WhereClip where2 = new WhereClip(); where2 = where2 && videoclass._.id == lb; modelclass = mgr.GetItemById(where2); res = string.Format(@"<a href='Category.aspx?type=video'>视频频道</a> > <a href='Category.aspx?sid={0}&type=video'>{1}</a>", modelclass.id, modelclass.classname); } else { res = "<a href='Category.aspx?type=video'>视频频道</a>"; } return res; }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { video ep = new videoManager().GetvideoItemById(video._.id == id); if (ep != null) { viewTitle = ep.title; viewurl = ep.vurl; viewContent = ep.contents; if (ep.addtime.HasValue) { publishTime = ep.addtime.Value.ToString("yyyy年MM月dd日"); } } } }
private void GenerVideo() { List<video> list = new videoManager().GetvideoList(); StringBuilder sb = new StringBuilder(@"<table width='100%' border='0' cellpadding='0' cellspacing='0' background='images/nzcms/right_bg2.gif'> <tr> <td height='30' align='center' class='white12B'> :: 视频频道 :: </td> </tr> </table>"); foreach (video item in list) { sb.AppendFormat(@" <a href='viewShowNew.aspx?type=video&sid={3}&id={0}' target='_blank' ><img src='{2}' style=' height: 160px; width: 250px; '></a> <table width='100%' border='0' cellpadding='0' cellspacing='0' background='images/nzcms/left2.gif'> <tr> <td height='30' align='center' class='white12b'> <a href='viewShowNew.aspx?type=video&sid={3}&id={0}' target='_blank' >{1}</a> </td> </tr> </table>", item.id, item.title, item.vpic,item.sid); } //sb.Append(" </tr> </table>"); OutStr = sb.ToString(); }