I am having issues with setting properties of a user control during Page_Load of the hosting page. My attempts are usually met with "Control not declared" or "Object reference not set to an instance of an object".
The user control is just a label (just for testing - I will be doing much more later on). I have added one public property called LabelText. It is registered properly:
<%@ Register TagPrefix="uc1" TagName="MyUserControl" Src="MyUserControl.ascx" %>
In the HTML, I can set this property at design time with no problem. However, in the page load event, I try to do something like MyUserControl1.LabelText = "test" and I am met with one of the errors listed above. I have used the declaration "Dim MyUserControl1 as MyUserControl" to the same effect.
According to gotdotnet
http://samples.gotdotnet.com/quickst...bpagelets.aspx
setting the properties should be strightforward. What am I missing?
Eventually, this will be a dynamic navigation panel - but I will need to set nav links at page load time.
Thanks in advance,
Colonel
- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.