void ITemplate.InstantiateIn(Control container) { // Add header var ctlHeader = new HtmlGenericControl("div"); ctlHeader.Attributes.Add("class", "ajax__twitter_header"); container.Controls.Add(ctlHeader); // Create Profile Image Url var ctlProfileImage = new Image() { ImageUrl = _twitter.ProfileImageUrl }; ctlHeader.Controls.Add(ctlProfileImage); // Create Title var ctlTitle = new HtmlGenericControl("h3"); ctlTitle.Controls.Add(new LiteralControl(_twitter.Title)); ctlHeader.Controls.Add(ctlTitle); // Create Caption var ctlCaption = new HtmlGenericControl("h4"); ctlCaption.Controls.Add(new LiteralControl(_twitter.Caption)); ctlHeader.Controls.Add(ctlCaption); // Add unordered list var ctlList = new HtmlGenericControl("ul"); ctlList.Attributes.Add("class", "ajax__twitter_itemlist"); ctlList.Style.Add("margin", "0px"); container.Controls.Add(ctlList); // Create item placeholder var plhItem = new PlaceHolder(); plhItem.ID = "ItemPlaceholder"; ctlList.Controls.Add(plhItem); var ctlFooter = new HtmlGenericControl("div"); var smallLogoUrl = _twitter.Page.ClientScript.GetWebResourceUrl(_twitter.GetType(), "Twitter.Twitter24.png"); ctlFooter.Attributes.Add("class", "ajax__twitter_footer"); ctlFooter.Controls.Add(new Image() { ImageUrl = smallLogoUrl }); container.Controls.Add(ctlFooter); }