public partial class ucAboutBiography : AUserControl { protected PageContent oContent; protected MSA.Main.Business.Contact oContact; // Conflicts with "Contact" us page public override void Setup(string contentLookup) { this.GetBioContent(contentLookup); } private void GetBioContent(string lookup) { this.oContent = new PageContent(); this.oContent.GetContentByContentLookup("BIO", lookup); if (this.oContent.Entity.HasValues) { this.lblName.Text = this.oContent.Entity.ContentName; this.lblTitle.Text = this.oContent.Entity.ContentDescription; this.BioContent.Text = this.oContent.Entity.ContentText; // Get the photo if there is one if (this.oContent.Entity.ContributorID != null) { Session["contactid"] = this.oContent.Entity.ContributorID.ToString(); this.imgBoardPhoto.ImageUrl = @"~/ShowPhoto.aspx"; } } else { this.lblName.Text = "Biography Not Found"; this.lblTitle.Text = ""; this.BioContent.Text = ""; this.imgBoardPhoto.ImageUrl = @"~/Images/ComingSoon.jpg"; } } } // End of ClassThen here is the code in the ShowPhoto.aspx that shows the photo.
public partial class ShowPhoto : mmBusinessWebPage { /// <summary> /// Page Load Handler /// </summary> /// <param name="sender">Event Source</param> /// <param name="e">Event Args</param> protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.ContentType = "image/pjpeg"; if (Session["contactid"] != null) { Guid contactId = new Guid(Session["contactid"].ToString()); var oContact = new MSA.Main.Business.Contact(); oContact.GetContactByID(contactId); // Show the Photo Response.BinaryWrite(oContact.Entity.DocumentPhoto); } else { Response.WriteFile(@"~/Images/ComingSoon.jpg"); } Response.End(); } }Since the bio control is displayed fine and the bio content is displayed and updates fine I didn't post any of the code that deals with placing the control from the hosting page.