I have an image on my web page with a skinID. Based on a condition I want to alter the SkinID at runtime. I used this:
Me.imgCheckOn.SkinID = "CheckedOn" where imgCheckOn is an ASP Image.
I get the following error:
The 'SkinId' property can only be set in or before the Page_PreInit event for static controls. For dynamic controls, set the property before adding it to the Controls collection.
The problem is, if I put the code in the page_PreInit event imgCheckOn does not exist at this point. Any ideas?