protected void Page_Load(object sender, EventArgs e) { if (_itemIndex % 2 == 0) { LitSectionTag.Text = String.Format("<section class=\"half-panel {0} clearfix\"> ", "fl"); } else { LitSectionTag.Text = String.Format("<section class=\"half-panel {0} clearfix\"> ", "fr"); } YoutubeHelper youtubeHelper = new YoutubeHelper(); LitYoutubeLink.Text = string.Format( "<iframe width='480' height='300' frameborder='0' src='http://www.youtube.com/embed/{0}?wmode=transparent' wmode='Opaque'></iframe>", youtubeHelper.YoutubeIDGet( _currentVideoItem.YoutubeCode.Url)); LitTextLink.Text = string.Format("<h3><a href=\"{0}\"> {1}</a></h3>", _currentVideoItem.Link.Url, _currentVideoItem.Heading.Rendered); LitSectionEndTag.Text = "</section>"; }
protected void youtubeHotSpot_DataBound(object Sender, RepeaterItemEventArgs e) { Item item = e.Item.DataItem as Item; HotspotItem hotspot = new HotspotItem(item); YoutubeHelper youtubeHelper = new YoutubeHelper(); string iframe = String.Format("<iframe width=\"335\" height=\"188\" src=\"http://www.youtube.com/embed/{0}?wmode=transparent\" frameborder=\"0\" allowfullscreen></iframe>", youtubeHelper.YoutubeIDGet(hotspot.Videolink.Text)); Literal iframeLiteral = e.Item.FindControl("iframe") as Literal; iframeLiteral.Text = iframe; }