I am converting a 1.1 project to 2.0 and am having an issue with some User Controls.
In the original project, there was a class library project and the website project. In the class library project, there was a folder called UserControls and in this were several ascx files and their code behind files.
I'd like to keep the same structure so I bring in these user controls into my new solution in a separate class library project. I changed it from being a full class to a partial class and changed the CodeBehind to CodeFile of the page.
In the old user control, all the web controls in the User control were listed like follows
protected System.Web.UI.WebControls.DropDownList _findModeList;
etc.
I thought with it being .net 2 and using the CodeFile attribute instead, I may not need to do this but it doesn't compile when I omit it.
However, when I include it, it does compile, but I get "Object reference not set to an instance of an object." error when trying to use _findModeList in the code file.
Is it possible to put User Controls in a class library in .net 2.0 up?