Posted on: 2/6/2014 9:58:34 PM | Views : 647

I have a usercontrol that i want to dynamically add  on a webform, based on the data returned by a query. With the below code, I am having issues with accessing the properties of the usercontrol. The error is "ImageSource' is not a member of System.Web.Ui.UserControl". Any idea what I am doing wrong here? 
On ASPX:
<%@ Register Src="~/Reuse/WhatsNew.ascx" TagName="whatsnew" TagPrefix="uc1" %>

On code behind: 
If (dt.Rows.Count > 0) Then Dim ucWhatsNew As UserControl = LoadControl("~/Reuse/WhatsNew.ascx")
For Each objTagRow As DataRow In vOut.Rows ucWhatsNew.ImageSource = objTagRow("UrlToIconGraphic") ucWhatsNew.Title = objTagRow("Title") ucWhatsNew.Body = objTagRow("Body") ucWhatsNew.ReadMoreLink = objTagRow("LinkToMoreInfo") Go to the complete details ...