Friday, September 26, 2008 by Nandu
A friend of mine placed the user controls in the /usercontrols folder of the virtual directory and added the user control reference in the default.master. When he tried to see the page in browser he got the follwing error:
The referenced file ‘/usercontrols/someusercontrol.ascx’ is not allowed on this page.
When the same usercontrol was placed in the _Controltemplates folder of the 12 hive, things worked.
We went through the we.config and found that _controltemplates folder entry was made in the <SafeControls> section.
We added an entry for the usercontrols folder and things worked fine.