技术分发ASP.NET用户控件跨项目 [英] Techniques For Distributing ASP.NET User Controls Across Projects

查看:129
本文介绍了技术分发ASP.NET用户控件跨项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你想创建,可以由不同的项目中使用的控件库在不同的项目分布ASP.NET用户控件可以是非常有用的。

Distributing ASP.NET user controls across different projects can be really useful when you want to create a library of controls that can be used by different projects.

不幸的是,据我所知,ASP.NET(2.0至少)不支持这个非常干净。

Unfortunately, to my knowledge, ASP.NET (2.0 at least) doesn't support this very cleanly.

我知道的唯一方法是将控件添加到另一个项目,然后复制ASCX(只有ASCX,除非你想扩展过程控制)文件到引用控制项目,并取出$ C从中$ cBehind参考。

The only technique I know of is to add the control to another project, then copy the ascx (and only the ascx, unless you want to extend the control of course) file into the project that references the control, and remove the CodeBehind reference from it.

它的工作原理,但感觉hackish的。

It works, but it feels hackish.

有谁知道一个更好的方式来跨项目拆分控制? (也许是不知何故3.5帮助?)

Does anyone know of a better way to split controls across projects? (perhaps 3.5 helps somehow?)

推荐答案

您可以看看这篇文章由Scott Guthrie的:

You could check out this article by Scott Guthrie:

建设可重用的ASP.NET用户控件和页面图书馆用VS 2005

这篇关于技术分发ASP.NET用户控件跨项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆