采用直接在网站项目里面加入用户控件,编译发布会将用户控件都编译进DLL,这不是我想要的。我想要实现的就是AspNetForums2.0的换肤功能,用户控件可以随时修改,以达到修改界面的目的。
因此,我采用的就是LoadControl方法加载ascx文件,编译通过,但运行出现以下错误:Server Error in '/test' Application.
--------------------------------------------------------------------------------The file '~/Skins/aaa.ascx' has not been pre-compiled, and cannot be requested. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The file '~/Skins/aaa.ascx' has not been pre-compiled, and cannot be requested.上面的错误也就是提示说只能加载预编译了的用户控件,这也就是意味着AspNetForums2.0的方法在ASP.NET2.0中没法实现了哟!