简体   繁体   English

扩展asp.net代码隐藏事件

[英]Extending asp.net code-behind events

I am working on a project wherein I am using a external open-source library for managing roles of forms authenticated users on my SharePoint web application ( http://sharepoint2010fba.codeplex.com/ ). 我正在做一个项目,其中我正在使用外部开放源代码库来管理SharePoint Web应用程序( http://sharepoint2010fba.codeplex.com/ )上经过身份验证的表单用户的角色。

All the functionality (for eg creating new roles, users etc.) are coded in to the aspx code-behind events. 所有功能(例如,创建新角色,用户等)都编码为aspx代码隐藏事件。 Now I need to extend these methods to add more functionality. 现在,我需要扩展这些方法以添加更多功能。

What would be the best design approach to extend the functionality in the scenario as above? 在上述方案中扩展功能的最佳设计方法是什么?

Thanks, Sharath 谢谢,Sharath

One way to extend code without changing the original code is to use MEF, the Managed Extensibility Framework. 扩展代码而不更改原始代码的一种方法是使用MEF(托管扩展框架)。

MEF targets .net framework 4.0, since you are using SharePoint you are probably on 3.5. MEF的目标是.net Framework 4.0,因为您使用的是SharePoint,因此可能在3.5上。

See Does MEF require .NET 4? 请参阅MEF是否需要.NET 4? for how to get MEF to work on 3.5. 有关如何使MEF在3.5上运行的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM