您的位置:首页 > 编程语言 > ASP

ASP.Net User Control Best Practice

2007-12-05 15:14 561 查看
My previous post about invalid cast exceptions turned out to be inaccurate. Unfortunately, it was more in depth than that. I am working on a project that has 37 user controls. Until today, those controls were dispersed throughout the project in different sub folders. This apparently is a bad practice. If you have controls in two separate folders and Control A in folder Z references Control B in folder Y; and then you have Control C in folder Y referencing Control D in folder Z, that creates a circular reference. This is because each folder in a website compiles into a separate assembly. Assemblies cannot have circular references.

Here's an article explaining it a bit more. Moral of the story, put all your controls in a single directory or take the painstaking effort to be sure references don't exist in two directions.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐