DOH! Referencing Visual Web Part in Master Page
Had a very huge brainfart today and I wanted to post the issue in case someone else runs into this due to lack of sleep and/or lack of concentration.
Was developing a visual web part and I kept getting the lovely “Object not set to the instance of an object” error. Debugging the code, the error was happening when I tried to load additional controls into the control I already declared in my “visual” part (the ascx file). WTF. It’s THERE! I see it! RIGHT THERE!
Well, if you declare the control within your master page, make sure you register it using the “src=~/controltemplates/yourusercontrol.ascx” and NOT the full Assembly/Namespace. OF COURSE, there’s no control! DOH!