posted on Monday, September 12, 2005 10:38 PM
by
rohanthomas
UserControl/dynamic usercontrol cant be recognised!!
I was using a usercontrol on the master page and all the content pages were able to reference that control and manipulate it successfully. But then, sometimes, VS will thro errors saying that the user control references on "some" content pages cannot be recognised. Are u missing a reference or an assembly??
Huh?? it was working just during the previous build! What on earth did I do to make it throw an error??
Well, i got latest for all the files and asked everyone on my team to check in their files, got latest for all files and recompiled! Surprise, surprise! It works! No more error... The error is gone, just like that...
It was getting frustating... After some sniffing around, this is what i found.
In the content aspx page, you need to add a <%@ Reference %> directive for the usercontrol on the master page that you manipulate from the contect page. This is actually the same case when you are dealing with dynamically loaded usercontrols or pages with no code-behind classes...
Just in case you'd like to read further; check out Scott Gu's Blog post on Compatibility Testing with ASP.NET 2.0.
Cheers!