Since I am building a webapplication in ASP.NET 2.0 Beta2 I came across some things that struck me as odd. Hopefully you will be able to move forward quicker than I did when I stumbled onto them.
- Pages, user controls and master pages that are in subfolders and use local resources should place the resx files into a subfolder called App_LocalResources, inside their own subfolder. So, don’t place them inside the root App_LocalResources folder.
- Sometimes you might get an errors like: Cannot cast type “ProfileCommon” to type “ProfileCommon” or missing namespace or reference errors for a control that you just worked on.
In such cases there might be a mixup on the assembly versions or whatever. Just touch the file that reports the error (change it without changing it, and save it again) or the containing file. In the case of the ProfileCommon error, you need to change a property inside the web.config, save, refresh a page, undo change and save and refresh again. This works for me.
- <%@ Register does more than only register a tag and prefix. Even if you are not using a tag for a user control (e.g. when you add them programmatically) in a page, you still need to <%@ Register these. It references the other assembly into which the user controls are compiled together. Without this it might/will not work
Question for you: how do you add page-level event handlers (e.g. Page.PreRender) through the VS2005 interface, so without typing the methods (like protected void Page_PreRender(…) and so on) yourself?